refactor: project directory structure

This commit is contained in:
0xJacky 2023-11-26 18:59:12 +08:00
parent c1193a5b8c
commit e5a5889931
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
367 changed files with 710 additions and 756 deletions

View file

@ -0,0 +1,50 @@
<script setup lang="ts">
import gettext from '@/gettext'
import {ref, watch} from 'vue'
import {useSettingsStore} from '@/pinia'
import {useRoute} from 'vue-router'
import http from '@/lib/http'
const settings = useSettingsStore()
const route = useRoute()
const current = ref(gettext.current)
const languageAvailable = gettext.available
function init() {
if (current.value !== 'en') {
http.get('/translation/' + current.value).then(r => {
gettext.translations[current.value] = r
})
}
}
init()
watch(current, (v) => {
init()
settings.set_language(v)
gettext.current = v
// @ts-ignored
document.title = route.name() + ' | Nginx UI'
})
</script>
<template>
<div>
<a-select v-model:value="current" size="small" style="width: 60px">
<a-select-option v-for="(language, key) in languageAvailable" :value="key" :key="key">
{{ language }}
</a-select-option>
</a-select>
</div>
</template>
<style lang="less" scoped>
</style>