From c5f546d3fb0650981ea33fb670e114a4bd36213a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 15 Jul 2026 18:29:01 -0400 Subject: [PATCH] refac --- .../components/admin/Settings/Database.svelte | 59 +++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/src/lib/components/admin/Settings/Database.svelte b/src/lib/components/admin/Settings/Database.svelte index 1075270bd6..5296c860d2 100644 --- a/src/lib/components/admin/Settings/Database.svelte +++ b/src/lib/components/admin/Settings/Database.svelte @@ -9,13 +9,16 @@ import { getAllUserChats } from '$lib/apis/chats'; import { getAllUsers } from '$lib/apis/users'; import { exportConfig, importConfig } from '$lib/apis/configs'; + import AdminSettingRow from './AdminSettingRow.svelte'; + import AdminSettingSection from './AdminSettingSection.svelte'; const i18n: any = getContext('i18n'); export let saveHandler: Function; + let configImportInputElement: HTMLInputElement; const actionButtonClass = - 'px-0.5 text-xs text-gray-500 underline-offset-2 transition-colors hover:text-gray-900 hover:underline dark:text-gray-500 dark:hover:text-white'; + 'text-xs text-gray-500 transition-colors hover:text-gray-900 dark:text-gray-500 dark:hover:text-white'; const exportAllUserChats = async () => { let blob = new Blob([JSON.stringify(await getAllUserChats(localStorage.token))], { @@ -54,6 +57,7 @@
-
-
- {$i18n.t('Config')} + + + + -
+ > + {$i18n.t('Export')} + + + - {#if $config?.features.enable_admin_export ?? true} -
- {$i18n.t('Export')} + {#if $config?.features.enable_admin_export ?? true} + + + + + + -
- {/if} -
+ + + {/if}