mirror of
https://github.com/open-webui/open-webui
synced 2024-12-28 14:52:23 +00:00
refac
This commit is contained in:
parent
e40212a662
commit
9b8f9c689b
@ -124,12 +124,11 @@
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
await init();
|
|
||||||
} else {
|
} else {
|
||||||
await toggleModelById(localStorage.token, model.id);
|
await toggleModelById(localStorage.token, model.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await init();
|
||||||
_models.set(await getModels(localStorage.token));
|
_models.set(await getModels(localStorage.token));
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -183,7 +182,7 @@
|
|||||||
|
|
||||||
<div class=" my-2 mb-5" id="model-list">
|
<div class=" my-2 mb-5" id="model-list">
|
||||||
{#if models.length > 0}
|
{#if models.length > 0}
|
||||||
{#each filteredModels as model, modelIdx (`${model.id}-${modelIdx}`)}
|
{#each filteredModels as model, modelIdx (model.id)}
|
||||||
<div
|
<div
|
||||||
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-lg transition"
|
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-lg transition"
|
||||||
id="model-item-{model.id}"
|
id="model-item-{model.id}"
|
||||||
@ -266,7 +265,6 @@
|
|||||||
bind:state={model.is_active}
|
bind:state={model.is_active}
|
||||||
on:change={async () => {
|
on:change={async () => {
|
||||||
toggleModelHandler(model);
|
toggleModelHandler(model);
|
||||||
await _models.set(await getModels(localStorage.token));
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
Loading…
Reference in New Issue
Block a user