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:
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user