mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
refac
This commit is contained in:
1 parent
61301c1748
commit
a78a66e7de
315 files changed
+1164
-974
No files matched your search
@@ -65,11 +65,11 @@
|
||||
let deleteModelTag = '';
|
||||
|
||||
const inputClass =
|
||||
'h-7 w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-left text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
'h-7 w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-left text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
const textareaClass =
|
||||
'w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 py-2 text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
'w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 py-2 text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
const iconButtonClass =
|
||||
'inline-flex h-7 items-center justify-center rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-base-700 transition-colors hover:bg-base-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:hover:bg-white/[0.06]';
|
||||
'inline-flex h-7 items-center justify-center rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-base-700 transition-colors hover:bg-base-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:hover:bg-base-0/[0.06]';
|
||||
|
||||
const updateModelsHandler = async () => {
|
||||
updateCancelled = false;
|
||||
@@ -665,7 +665,7 @@
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 text-base-800 dark:text-white"
|
||||
class="w-4 h-4 text-base-800 dark:text-base-0"
|
||||
aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
@@ -714,7 +714,7 @@
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 text-base-800 dark:text-white"
|
||||
class="w-4 h-4 text-base-800 dark:text-base-0"
|
||||
aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
|
||||
@@ -51,9 +51,9 @@
|
||||
let providerModels: ProviderModel[] = [];
|
||||
|
||||
const inputClass =
|
||||
'h-7 w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-left text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
'h-7 w-full rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-left text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 disabled:opacity-50 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:focus:border-blue-500';
|
||||
const iconButtonClass =
|
||||
'inline-flex h-7 items-center justify-center rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-base-700 transition-colors hover:bg-base-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:hover:bg-white/[0.06]';
|
||||
'inline-flex h-7 items-center justify-center rounded-lg border border-base-100/50 bg-base-50/40 px-2.5 text-base-700 transition-colors hover:bg-base-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:hover:bg-base-0/[0.06]';
|
||||
|
||||
const getModelId = (model: ProviderModel) =>
|
||||
model.key ?? model.id ?? model.name ?? model.model ?? '';
|
||||
@@ -230,14 +230,14 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div
|
||||
class="max-h-96 overflow-y-auto rounded-lg border border-base-100/50 dark:border-white/[0.04]"
|
||||
class="max-h-96 overflow-y-auto rounded-lg border border-base-100/50 dark:border-base-0/[0.04]"
|
||||
>
|
||||
{#each providerModels as model}
|
||||
{@const modelId = getModelId(model)}
|
||||
{@const displayName = getDisplayName(model)}
|
||||
{@const status = getStatus(model)}
|
||||
<div
|
||||
class="flex items-center justify-between gap-2 border-b border-base-100/50 px-2 py-2 last:border-b-0 dark:border-white/[0.04]"
|
||||
class="flex items-center justify-between gap-2 border-b border-base-100/50 px-2 py-2 last:border-b-0 dark:border-base-0/[0.04]"
|
||||
>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-xs font-medium text-base-700 dark:text-base-200">
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
ariaLabel={$i18n.t('Manage Models')}
|
||||
size="sm"
|
||||
bind:show
|
||||
className="bg-white dark:bg-base-900 rounded-4xl"
|
||||
className="bg-base-0 dark:bg-base-900 rounded-4xl"
|
||||
>
|
||||
<div>
|
||||
<div class=" flex justify-between dark:text-base-100 px-4 pt-3 pb-1">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
let options: { id: string; key?: string; label: string; params: Record<string, any> }[] = [];
|
||||
let nameInput: HTMLInputElement;
|
||||
const actionClass =
|
||||
'flex size-7 shrink-0 items-center justify-center rounded-lg text-base-500 transition hover:bg-black/5 hover:text-base-700 dark:text-base-400 dark:hover:bg-white/5 dark:hover:text-base-200';
|
||||
'flex size-7 shrink-0 items-center justify-center rounded-lg text-base-500 transition hover:bg-base-1000/5 hover:text-base-700 dark:text-base-400 dark:hover:bg-base-0/5 dark:hover:text-base-200';
|
||||
const inputClass =
|
||||
'w-full min-w-0 bg-transparent py-1 text-[0.8125rem] outline-hidden placeholder:text-base-300 dark:placeholder:text-base-700 font-normal text-base-900 dark:text-base-100';
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
type="button"
|
||||
aria-pressed={display === mode}
|
||||
class="rounded-lg px-2 py-1 text-xs transition {display === mode
|
||||
? 'bg-base-100 text-base-900 dark:bg-base-800 dark:text-white'
|
||||
? 'bg-base-100 text-base-900 dark:bg-base-800 dark:text-base-0'
|
||||
: 'text-base-500 hover:text-base-700 dark:text-base-400 dark:hover:text-base-200'}"
|
||||
on:click={() => (display = mode as 'menu' | 'slider')}
|
||||
>
|
||||
@@ -335,7 +335,7 @@
|
||||
!options.length ||
|
||||
(display === 'slider' && options.length < 2) ||
|
||||
options.some((option) => !option.label.trim())}
|
||||
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:opacity-60 dark:bg-base-100 dark:text-base-900 dark:hover:bg-white"
|
||||
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-base-0 transition hover:bg-base-1000 disabled:opacity-60 dark:bg-base-100 dark:text-base-900 dark:hover:bg-base-0"
|
||||
>{$i18n.t('Apply')}</button
|
||||
>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user