t
This commit is contained in:
21
src/stores/appStore.js
Normal file
21
src/stores/appStore.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useAppStore = defineStore('app', {
|
||||
state: () => ({
|
||||
queryRetentionDays: 0,
|
||||
isLoaded: false,
|
||||
}),
|
||||
actions: {
|
||||
async fetchAppConfig() {
|
||||
try {
|
||||
const { data, error } = await useApiFetch('/app/config').get().json()
|
||||
if (data.value && !error.value && data.value.code === 200) {
|
||||
const cfg = data.value.data
|
||||
this.queryRetentionDays = Number(cfg.query_retention_days) || 0
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
this.isLoaded = true
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user