This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-15 16:31:27 -04:00
1 parent 9cfafc0608
commit 667cba1a95
5 files changed
+35 -22

No files matched your search

@@ -6,7 +6,7 @@
import { onMount, getContext, tick } from 'svelte'; import { onMount, getContext, tick } from 'svelte';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
import { WEBUI_NAME, config, mobile, models as _models, settings, user } from '$lib/stores'; import { config, models as _models, settings, user } from '$lib/stores';
import { import {
createNewModel, createNewModel,
deleteAllModels, deleteAllModels,
@@ -18,7 +18,6 @@
importModels importModels
} from '$lib/apis/models'; } from '$lib/apis/models';
import { copyToClipboard } from '$lib/utils'; import { copyToClipboard } from '$lib/utils';
import { page } from '$app/stores';
import { updateUserSettings } from '$lib/apis/users'; import { updateUserSettings } from '$lib/apis/users';
import { getModels } from '$lib/apis'; import { getModels } from '$lib/apis';
@@ -53,6 +52,8 @@
let shiftKey = false; let shiftKey = false;
export let tabState: Record<string, unknown> | null = null;
let modelsImportInProgress = false; let modelsImportInProgress = false;
let importFiles; let importFiles;
let modelsImportInputElement: HTMLInputElement; let modelsImportInputElement: HTMLInputElement;
@@ -73,6 +74,11 @@
let tags: string[] = []; let tags: string[] = [];
let selectedTag = ''; let selectedTag = '';
$: if (typeof tabState?.id === 'string' && tabState.id) {
selectedModelId = tabState.id;
tabState = null;
}
const perPage = 30; const perPage = 30;
let currentPage = 1; let currentPage = 1;
@@ -399,11 +405,6 @@
onMount(async () => { onMount(async () => {
await init(); await init();
const id = $page.url.searchParams.get('id');
if (id) {
selectedModelId = id;
}
const onKeyDown = (event) => { const onKeyDown = (event) => {
if (event.key === 'Shift') { if (event.key === 'Shift') {
@@ -9,7 +9,7 @@
import PinSlash from '$lib/components/icons/PinSlash.svelte'; import PinSlash from '$lib/components/icons/PinSlash.svelte';
import Link from '$lib/components/icons/Link.svelte'; import Link from '$lib/components/icons/Link.svelte';
import Pencil from '$lib/components/icons/Pencil.svelte'; import Pencil from '$lib/components/icons/Pencil.svelte';
import { config, settings, user } from '$lib/stores'; import { config, settings, showSettings, user } from '$lib/stores';
import GlobeAlt from '$lib/components/icons/GlobeAlt.svelte'; import GlobeAlt from '$lib/components/icons/GlobeAlt.svelte';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
@@ -53,11 +53,11 @@
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
goto( if (model?.preset || model?.info?.base_model_id) {
model?.preset || model?.info?.base_model_id goto(`/workspace/models/edit?id=${encodeURIComponent(model?.id ?? '')}`);
? `/workspace/models/edit?id=${encodeURIComponent(model?.id ?? '')}` } else {
: `/admin/settings/models?id=${encodeURIComponent(model?.id ?? '')}` showSettings.set({ tab: 'admin:models', state: { id: model?.id ?? null } });
); }
show = false; show = false;
}} }}
> >
@@ -306,10 +306,7 @@
</div> </div>
<Textarea <Textarea
bind:value={system} bind:value={system}
className={'w-full text-sm outline-hidden resize-vertical' + className="w-full resize-vertical appearance-none bg-transparent text-sm outline-hidden focus:bg-transparent disabled:bg-transparent dark:text-gray-300"
($settings.highContrastMode
? ' p-2.5 border-2 border-gray-300 dark:border-gray-700 rounded-lg bg-transparent text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 overflow-y-hidden'
: ' dark:text-gray-300 ')}
rows="4" rows="4"
placeholder={$i18n.t('Enter system prompt here')} placeholder={$i18n.t('Enter system prompt here')}
/> />
+14 -4
View File
@@ -3,6 +3,7 @@
import type { Writable } from 'svelte/store'; import type { Writable } from 'svelte/store';
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner';
import { config, models, settings, user } from '$lib/stores'; import { config, models, settings, user } from '$lib/stores';
import type { SettingsModalRequest } from '$lib/stores';
import { updateUserSettings } from '$lib/apis/users'; import { updateUserSettings } from '$lib/apis/users';
import { getBackendConfig, getModels as _getModels } from '$lib/apis'; import { getBackendConfig, getModels as _getModels } from '$lib/apis';
@@ -51,13 +52,20 @@
const i18n: Writable<any> = getContext('i18n'); const i18n: Writable<any> = getContext('i18n');
export let show: boolean | string = false; export let show: boolean | string | SettingsModalRequest = false;
let modalShow = false; let modalShow = false;
let lastShow: boolean | string = false; let lastShow: boolean | string | SettingsModalRequest = false;
let tabState: Record<string, unknown> | null = null;
$: if (show !== lastShow) { $: if (show !== lastShow) {
lastShow = show; lastShow = show;
if (typeof show === 'string') { if (show && typeof show === 'object') {
selectedTab = show.tab;
tabState = show.state ?? null;
show = true;
lastShow = true;
modalShow = true;
} else if (typeof show === 'string') {
selectedTab = show; selectedTab = show;
show = true; show = true;
lastShow = true; lastShow = true;
@@ -66,6 +74,7 @@
modalShow = show; modalShow = show;
if (!show) { if (!show) {
selectedTab = 'general'; selectedTab = 'general';
tabState = null;
} }
} }
} }
@@ -74,6 +83,7 @@
show = false; show = false;
lastShow = false; lastShow = false;
selectedTab = 'general'; selectedTab = 'general';
tabState = null;
} }
interface SettingsTab { interface SettingsTab {
@@ -1130,7 +1140,7 @@
}} }}
/> />
{:else if selectedTab === 'admin:models'} {:else if selectedTab === 'admin:models'}
<AdminModels /> <AdminModels bind:tabState />
{:else if selectedTab === 'admin:subagents'} {:else if selectedTab === 'admin:subagents'}
<AdminSubagents /> <AdminSubagents />
{:else if selectedTab === 'admin:evaluations'} {:else if selectedTab === 'admin:evaluations'}
+6 -1
View File
@@ -111,9 +111,14 @@ export const chatRequestQueues: Writable<
export const sidebarWidth = writable(245); export const sidebarWidth = writable(245);
export type SettingsModalRequest = {
tab: string;
state?: Record<string, unknown> | null;
};
export const showSidebar = writable(false); export const showSidebar = writable(false);
export const showSearch = writable(false); export const showSearch = writable(false);
export const showSettings: Writable<boolean | string> = writable(false); export const showSettings: Writable<boolean | string | SettingsModalRequest> = writable(false);
export const showChangelog = writable(false); export const showChangelog = writable(false);
export const showControls = writable(false); export const showControls = writable(false);