feat(settings): Add independent plugin to put loading system configuration in the lifecycle hook "app:created".

This commit is contained in:
Rafi
2023-04-18 10:29:09 +08:00
parent 9fe7943152
commit 76b865646c
8 changed files with 72 additions and 79 deletions

View File

@@ -3,7 +3,7 @@ import { useDisplay } from 'vuetify'
import {useDrawer} from "../composables/states";
const route = useRoute()
const { $i18n } = useNuxtApp()
const { $i18n, $settings } = useNuxtApp()
const colorMode = useColorMode()
const {mdAndUp} = useDisplay()
const drawerPermanent = computed(() => {
@@ -88,11 +88,6 @@ const loadConversations = async () => {
loadingConversations.value = false
}
const settings = useSettings()
const showApiKeySetting = computed(() => {
return settings.value && settings.value.open_api_key_setting && settings.value.open_api_key_setting === 'True'
})
const signOut = async () => {
const { data, error } = await useFetch('/api/account/logout/', {
method: 'POST'
@@ -277,7 +272,7 @@ const drawer = useDrawer()
</v-dialog>
<ApiKeyDialog
v-if="showApiKeySetting"
v-if="$settings.open_api_key_setting === 'True'"
/>
<ModelParameters/>