optimize open database calls

This commit is contained in:
Adrian Zürcher
2026-02-23 21:23:14 +01:00
parent ec5893db57
commit fa58872840
15 changed files with 133 additions and 155 deletions

View File

@@ -52,7 +52,7 @@ import { appApi } from 'src/boot/axios';
import { i18n } from 'src/boot/lang';
import SiteTitle from 'src/vueLib/general/SiteTitle.vue';
import { useNotify } from 'src/vueLib/general/useNotify';
import { databaseName, workspace } from 'src/vueLib/models/settings';
import { useUserStore } from 'src/vueLib/login/userStore';
import { onMounted, ref } from 'vue';
const stats = ref();
@@ -71,8 +71,11 @@ const amounts = ref<{
const { NotifyResponse } = useNotify();
onMounted(async () => {
let path = databaseName.value;
if (workspace.value !== '') path = workspace.value + '/' + path;
const user = useUserStore().user;
const workspaceUuid = useUserStore().getWorkspaceUuid;
let path = user?.settings?.databaseName;
if (workspaceUuid !== undefined) path = workspaceUuid + '/' + path;
stats.value = await appApi
.post('/stats', { database: path })
.then((resp) => {