Root source

This commit is contained in:
James Cole 2022-02-27 10:12:54 +01:00
parent cabd3d60f0
commit 95a7a0c90d
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
5 changed files with 126 additions and 0 deletions

62
frontend/src/App.vue Normal file
View File

@ -0,0 +1,62 @@
<template>
<router-view/>
</template>
<script>
import {defineComponent} from 'vue';
import Preferences from "./api/preferences";
import Currencies from "./api/currencies";
import {setDatesFromViewRange} from "./store/fireflyiii/actions";
export default defineComponent(
{
name: 'App',
preFetch({store}) {
store.dispatch('fireflyiii/refreshCacheKey');
const getViewRange = function() {
let pref = new Preferences();
return pref.getByName('viewRange').then(data => {
const viewRange = data.data.data.attributes.data;
store.commit('fireflyiii/updateViewRange', viewRange);
store.dispatch('fireflyiii/setDatesFromViewRange');
}).catch((err) => {
console.error('Could not load view range.')
console.log(err);
});
};
const getListPageSize = function() {
let pref = new Preferences();
return pref.getByName('listPageSize').then(data => {
const listPageSize = data.data.data.attributes.data;
store.commit('fireflyiii/updateListPageSize', listPageSize);
}).catch((err) => {
console.error('Could not load listPageSize.')
console.log(err);
});
};
const getDefaultCurrency = function() {
let curr = new Currencies();
return curr.default().then(data => {
let currencyId = parseInt(data.data.data.id);
let currencyCode = data.data.data.attributes.code;
store.commit('fireflyiii/setCurrencyId', currencyId);
store.commit('fireflyiii/setCurrencyCode', currencyCode);
}).catch((err) => {
console.error('Could not load preferences.');
console.log(err);
});
};
getDefaultCurrency().then(() => {
getViewRange();
getListPageSize();
});
}
})
</script>

7
frontend/src/env.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string;
VUE_ROUTER_MODE: 'hash' | 'history' | 'abstract' | undefined;
VUE_ROUTER_BASE: string | undefined;
}
}

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title><%= productName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="apple-touch-icon" sizes="76x76" href="maskable76.png">
<link rel="apple-touch-icon" sizes="120x120" href="maskable120.png">
<link rel="apple-touch-icon" sizes="152x152" href="maskable152.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#3c8dbc">
<link href="maskable192.png" rel="icon" sizes="192x192">
<link href="maskable128.png" rel="icon" sizes="128x128">
<link rel="manifest" href="manifest.webmanifest">
<meta name="msapplication-TileColor" content="#1e6581">
<meta name="msapplication-TileImage" content="maskable512.png">
<meta name="msapplication-tap-highlight" content="no">
<meta name="application-name" content="Firefly III">
<meta name="robots" content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Firefly III">
<meta name="application-name" content="Firefly III">
<meta name="msapplication-TileColor" content="#3c8dbc">
<meta name="msapplication-TileImage" content="mstile-144x144.png?v=3e8AboOwbd">
<meta name="theme-color" content="#3c8dbc">
</head>
<body>
<div id="q-app"></div>
</body>
</html>

7
frontend/src/quasar.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Forces TS to apply `@quasar/app` augmentations of `quasar` package
// Removing this would break `quasar/wrappers` imports as those typings are declared
// into `@quasar/app`
// As a side effect, since `@quasar/app` reference `quasar` to augment it,
// this declaration also apply `quasar` own
// augmentations (eg. adds `$q` into Vue component context)
/// <reference types="@quasar/app" />

7
frontend/src/shims-vue.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Mocks all files ending in `.vue` showing them as plain Vue instances
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}