mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
refac
This commit is contained in:
1 parent
fc0f0701c5
commit
c78060a62d
15 files changed
+325
-19
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte';
|
||||
import { getChangedKeys } from '$lib/utils';
|
||||
|
||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||
@@ -18,15 +19,7 @@
|
||||
let saveButton: HTMLButtonElement;
|
||||
let showConfirm: boolean = false;
|
||||
|
||||
// numbers typed into text fields and cleared fields compare equal to what was loaded
|
||||
const serialize = (value: any) =>
|
||||
value !== null && typeof value === 'object' ? JSON.stringify(value) : String(value ?? '');
|
||||
|
||||
$: changedKeys = savedConfig
|
||||
? Object.keys({ ...savedConfig, ...settings }).filter(
|
||||
(key) => serialize(savedConfig[key]) !== serialize(settings?.[key])
|
||||
)
|
||||
: [];
|
||||
$: changedKeys = getChangedKeys(savedConfig, settings);
|
||||
|
||||
const formatValue = (value: any) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
|
||||
Reference in new issue
Block a user