mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 16:26:18 +00:00
Completed feature for #843
This commit is contained in:
@@ -4,6 +4,7 @@ import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.
|
||||
import {computed, watch} from "vue";
|
||||
const store = DashboardConfigurationStore();
|
||||
import "@/utilities/wireguard.js"
|
||||
import {fetchGet} from "@/utilities/fetch.js";
|
||||
store.initCrossServerConfiguration();
|
||||
if (window.IS_WGDASHBOARD_DESKTOP){
|
||||
store.IsElectronApp = true;
|
||||
@@ -15,7 +16,9 @@ watch(store.CrossServerConfiguration, () => {
|
||||
deep: true
|
||||
});
|
||||
const route = useRoute()
|
||||
|
||||
fetchGet("/api/locale", {}, (res) => {
|
||||
store.Locale = res.data
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@@ -11,13 +11,15 @@ import router from './router/router.js'
|
||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
let Locale;
|
||||
await fetch("/api/locale")
|
||||
.then(res => res.json())
|
||||
.then(res => Locale = res.data)
|
||||
.catch(() => {
|
||||
Locale = null
|
||||
})
|
||||
const app = createApp(App)
|
||||
|
||||
// await fetch("/api/locale")
|
||||
// .then(res => res.json())
|
||||
// .then(res => Locale = res.data)
|
||||
// .catch(() => {
|
||||
// Locale = null
|
||||
// })
|
||||
|
||||
app.use(router)
|
||||
const pinia = createPinia();
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
@@ -27,6 +29,4 @@ pinia.use(({ store }) => {
|
||||
|
||||
|
||||
app.use(pinia)
|
||||
const store = DashboardConfigurationStore()
|
||||
store.Locale = Locale;
|
||||
app.mount('#app')
|
@@ -20,7 +20,7 @@ export const DashboardConfigurationStore = defineStore('DashboardConfigurationSt
|
||||
ActiveServerConfiguration: undefined,
|
||||
IsElectronApp: false,
|
||||
ShowNavBar: false,
|
||||
Locale: undefined,
|
||||
Locale: null,
|
||||
HelpAgent: {
|
||||
Enable: false
|
||||
}
|
||||
|
Reference in New Issue
Block a user