mirror of
https://github.com/open-webui/open-webui
synced 2025-04-15 21:13:44 +00:00
refac: styling
This commit is contained in:
parent
7f8c70b04a
commit
7e78889e33
@ -18,11 +18,12 @@
|
||||
import Search from '$lib/components/icons/Search.svelte';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import Switch from '$lib/components/common/Switch.svelte';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
|
||||
let importFiles;
|
||||
let modelsImportInputElement: HTMLInputElement;
|
||||
|
||||
let models = [];
|
||||
let models = null;
|
||||
let filteredModels = [];
|
||||
|
||||
$: if (models) {
|
||||
@ -65,6 +66,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if models !== null}
|
||||
<div class="flex flex-col gap-1 mt-1.5 mb-2">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center md:self-center text-xl font-medium px-0.5">
|
||||
@ -152,7 +154,9 @@
|
||||
{/if}
|
||||
|
||||
<div class="ml-1">
|
||||
<Tooltip content={(model?.is_active ?? true) ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
|
||||
<Tooltip
|
||||
content={(model?.is_active ?? true) ? $i18n.t('Enabled') : $i18n.t('Disabled')}
|
||||
>
|
||||
<Switch
|
||||
bind:state={model.is_active}
|
||||
on:change={async (e) => {
|
||||
@ -188,9 +192,11 @@
|
||||
for (const model of savedModels) {
|
||||
if (model?.info ?? false) {
|
||||
if ($_models.find((m) => m.id === model.id)) {
|
||||
await updateModelById(localStorage.token, model.id, model.info).catch((error) => {
|
||||
await updateModelById(localStorage.token, model.id, model.info).catch(
|
||||
(error) => {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
await createNewModel(localStorage.token, model.info).catch((error) => {
|
||||
return null;
|
||||
@ -257,3 +263,8 @@
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
<div class=" h-full w-full flex justify-center items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user