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
2f70a0248a
commit
76339161b0
469 files changed
+4845
-4822
No files matched your search
@@ -42,39 +42,41 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if changedKeys.length > 0}
|
||||
<div class="flex items-center gap-2">
|
||||
{#if changedKeys.length > 0}
|
||||
<button
|
||||
class="h-7 shrink-0 rounded-lg px-2 text-xs text-base-500 transition hover:text-base-900 dark:text-base-400 dark:hover:text-white"
|
||||
type="button"
|
||||
{disabled}
|
||||
on:click={() => {
|
||||
showConfirm = true;
|
||||
}}
|
||||
>
|
||||
{$i18n.t('{{count}} Changes', { count: changedKeys.length })}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
class="h-7 shrink-0 rounded-lg px-2 text-xs text-gray-500 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
||||
type="button"
|
||||
bind:this={saveButton}
|
||||
class="flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-lg bg-base-900 px-2.5 text-xs font-normal text-white transition hover:bg-black disabled:cursor-not-allowed disabled:opacity-60 dark:bg-base-100 dark:text-base-900 dark:hover:bg-white"
|
||||
type="submit"
|
||||
{disabled}
|
||||
on:click={() => {
|
||||
showConfirm = true;
|
||||
on:click={(event) => {
|
||||
if (changedKeys.length > 0 && saveButton.form!.checkValidity()) {
|
||||
event.preventDefault();
|
||||
showConfirm = true;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{$i18n.t('{{count}} Changes', { count: changedKeys.length })}
|
||||
{$i18n.t('Save')}
|
||||
|
||||
{#if loading}
|
||||
<span class="shrink-0">
|
||||
<Spinner className="size-3" />
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
bind:this={saveButton}
|
||||
class="flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-lg bg-gray-900 px-2.5 text-xs font-normal text-white transition hover:bg-black disabled:cursor-not-allowed disabled:opacity-60 dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-white"
|
||||
type="submit"
|
||||
{disabled}
|
||||
on:click={(event) => {
|
||||
if (changedKeys.length > 0 && saveButton.form!.checkValidity()) {
|
||||
event.preventDefault();
|
||||
showConfirm = true;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{$i18n.t('Save')}
|
||||
|
||||
{#if loading}
|
||||
<span class="shrink-0">
|
||||
<Spinner className="size-3" />
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#snippet settingValue(key: string, value: any)}
|
||||
{#if sensitiveKeys.includes(key) && value}
|
||||
@@ -95,22 +97,22 @@
|
||||
<div class="flex max-h-[60vh] flex-col gap-3 overflow-y-auto">
|
||||
{#each changedKeys as key (key)}
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-baseline gap-1.5 text-xs text-gray-600 dark:text-gray-400">
|
||||
<div class="flex items-baseline gap-1.5 text-xs text-base-600 dark:text-base-400">
|
||||
{labels[key] ?? key}
|
||||
{#if labels[key]}
|
||||
<span class="truncate font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
<span class="truncate font-mono text-[0.625rem] text-base-400 dark:text-base-600">
|
||||
{key}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-start gap-2 text-xs">
|
||||
<div
|
||||
class="min-w-0 flex-1 rounded-lg bg-gray-50 px-2 py-1 text-gray-500 dark:bg-gray-850 dark:text-gray-400"
|
||||
class="min-w-0 flex-1 rounded-lg bg-base-50 px-2 py-1 text-base-500 dark:bg-base-850 dark:text-base-400"
|
||||
>
|
||||
{@render settingValue(key, savedConfig?.[key])}
|
||||
</div>
|
||||
<ArrowRight className="mt-1.5 size-3 shrink-0 text-gray-400" />
|
||||
<div class="min-w-0 flex-1 rounded-lg bg-gray-50 px-2 py-1 dark:bg-gray-850">
|
||||
<ArrowRight className="mt-1.5 size-3 shrink-0 text-base-400" />
|
||||
<div class="min-w-0 flex-1 rounded-lg bg-base-50 px-2 py-1 dark:bg-base-850">
|
||||
{@render settingValue(key, settings?.[key])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user