mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: reload cluster node settings from settings file #169
This commit is contained in:
parent
29f1b7db89
commit
e0366f949f
13 changed files with 110 additions and 34 deletions
|
@ -1,32 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { watch } from 'vue'
|
||||
|
||||
import { useSettingsStore } from '@/pinia'
|
||||
import http from '@/lib/http'
|
||||
import gettext from '@/gettext'
|
||||
import loadTranslations from '@/api/translations'
|
||||
|
||||
const settings = useSettingsStore()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const current = ref(gettext.current)
|
||||
const current = computed({
|
||||
get() {
|
||||
return gettext.current
|
||||
},
|
||||
set(v) {
|
||||
gettext.current = v
|
||||
},
|
||||
})
|
||||
|
||||
const languageAvailable = gettext.available
|
||||
|
||||
async function init() {
|
||||
if (current.value !== 'en') {
|
||||
await http.get(`/translation/${current.value}`).then(r => {
|
||||
gettext.translations[current.value] = r
|
||||
})
|
||||
|
||||
document.title = `${route.meta.name?.()} | Nginx UI`
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
watch(current, v => {
|
||||
init()
|
||||
loadTranslations()
|
||||
settings.set_language(v)
|
||||
gettext.current = v
|
||||
|
||||
|
@ -34,7 +29,6 @@ watch(current, v => {
|
|||
|
||||
document.title = `${name()} | Nginx UI`
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue