diff --git a/src/boot/axios.ts b/src/boot/axios.ts index e6a8bc6..940b45a 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -4,8 +4,7 @@ import config from '../config'; import { Store } from 'vuex'; import { StateInterface } from 'src/store'; import { LocalStorage } from 'quasar'; -import {Notify} from 'quasar'; -import {Router} from 'src/router'; +import { Notify } from 'quasar'; declare module 'vue/types/vue' { interface Vue { @@ -17,21 +16,22 @@ export const setBaseUrl = (url: string) => { LocalStorage.set('baseURL', url); axios.defaults.baseURL = url; Notify.create({ - message: "Serveraddresse gespeichert", - position: "bottom", + message: 'Serveraddresse gespeichert', + position: 'bottom', caption: `${url}`, - color: "positive" - }) - setTimeout(() => {window.location.reload()}, 5000) - -} + color: 'positive' + }); + setTimeout(() => { + window.location.reload(); + }, 5000); +}; export default boot>(({ Vue, store, router }) => { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access Vue.prototype.$axios = axios; const baseURL = LocalStorage.getItem('baseURL'); - if (baseURL){ - axios.defaults.baseURL = baseURL + if (baseURL) { + axios.defaults.baseURL = baseURL; } else { axios.defaults.baseURL = config.baseURL; } diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 5a0a048..9800cfe 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -35,24 +35,21 @@ -
- +
- - -
- - - -
Servereinstellung
- - -
-
- -
+ +
+ + + +
Servereinstellung
+ + +
+
+
@@ -72,16 +69,16 @@ export default defineComponent({ const userid = ref(''); const password = ref(''); const rules = [(val: string) => (val && val.length > 0) || 'Feld darf nicht leer sein!']; - const server = ref(root.$axios.defaults.baseURL) + const server = ref(root.$axios.defaults.baseURL); const visible = ref(false); function openServerSettings() { - visible.value = !visible.value + visible.value = !visible.value; } function changeUrl() { if (server.value) { - setBaseUrl(server.value) + setBaseUrl(server.value); } } @@ -147,7 +144,17 @@ export default defineComponent({ }); } - return { userid, password, doLogin, doReset, rules, server, changeUrl, visible, openServerSettings }; + return { + userid, + password, + doLogin, + doReset, + rules, + server, + changeUrl, + visible, + openServerSettings + }; } }); diff --git a/src/plugins/balance/pages/Overview.vue b/src/plugins/balance/pages/Overview.vue index 10dc436..005fff0 100644 --- a/src/plugins/balance/pages/Overview.vue +++ b/src/plugins/balance/pages/Overview.vue @@ -16,7 +16,16 @@ :loading="loading" @request="onRequest" binary-state-sort - /> + > + + + @@ -24,7 +33,7 @@ diff --git a/src/plugins/balance/store/balance.ts b/src/plugins/balance/store/balance.ts index 3538d37..1fb3f17 100644 --- a/src/plugins/balance/store/balance.ts +++ b/src/plugins/balance/store/balance.ts @@ -9,6 +9,11 @@ interface BalanceResponse { debit: number; } +export interface TransactionsResponse { + transactions: Array; + count?: number; +} + export interface UserBalance extends BalanceResponse { limit: number | null; } @@ -121,7 +126,14 @@ const actions: ActionTree = { { commit, rootState }, payload: { userid?: string; - filter?: { limit?: number; offset?: number; from?: Date; to?: Date }; + filter?: { + limit?: number; + offset?: number; + from?: Date; + to?: Date; + showReversals?: boolean; + showCancelled?: boolean; + }; } ) { commit('setLoading'); @@ -129,22 +141,13 @@ const actions: ActionTree = { if (!payload.filter) payload.filter = { limit: 10 }; return axios .get(`/users/${payload.userid}/balance/transactions`, { params: payload.filter || {} }) - .then(({ data }: AxiosResponse<[FG.Transaction]>) => { - data.forEach(t => fixTransaction(t)); - commit('addTransactions', data); + .then(({ data }: AxiosResponse) => { + data.transactions.forEach(t => fixTransaction(t)); + commit('addTransactions', data.transactions); return data; }) .finally(() => commit('setLoading', false)); }, - getTransactionsCount( - { state }, - payload: { - userid?: string; - filter?: { limit?: number; offset?: number; from?: Date; to?: Date }; - } - ) { - return Promise.resolve(3); - }, getLimit({ rootState, commit }) { commit('setLoading'); axios