Change the functionality of custom API key to be controlled by the admin panel to determine whether it is enabled or not.

This commit is contained in:
Rafi
2023-03-24 15:43:01 +08:00
parent 4d09ff7c8a
commit 288c9eeeca
5 changed files with 13 additions and 5 deletions

View File

@@ -98,6 +98,15 @@ const signOut = async () => {
}
}
const settings = useSettings()
const showApiKeySetting = ref(false)
watchEffect(() => {
if (settings.value) {
const settingsValue = toRaw(settings.value)
showApiKeySetting.value = settingsValue.open_api_key_setting && settingsValue.open_api_key_setting === 'True'
}
})
onMounted(async () => {
loadConversations()
loadSettings()
@@ -240,7 +249,7 @@ onMounted(async () => {
</v-dialog>
<ApiKeyDialog
v-if="runtimeConfig.public.customApiKey"
v-if="showApiKeySetting"
/>
<ModelParameters/>