mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 13:40:55 +00:00
refac
This commit is contained in:
parent
708d755eda
commit
8bca17ee1d
@ -20,27 +20,23 @@
|
||||
let modelfilesImportInputElement: HTMLInputElement;
|
||||
|
||||
const deleteModelHandler = async (model) => {
|
||||
if (model?.info?.base_model_id) {
|
||||
console.log(model.info);
|
||||
if (!model?.info) {
|
||||
toast.error(
|
||||
$i18n.t('{{ owner }}: You cannot delete a base model', {
|
||||
owner: model.owned_by.toUpperCase()
|
||||
})
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
const res = await deleteModelById(localStorage.token, model.id);
|
||||
|
||||
if (res) {
|
||||
toast.success($i18n.t(`Deleted {{name}}`, { name: model.id }));
|
||||
}
|
||||
await models.set(await getModels(localStorage.token));
|
||||
} else if (model?.owned_by === 'ollama') {
|
||||
const res = await deleteModel(localStorage.token, model.id);
|
||||
|
||||
if (res) {
|
||||
toast.success($i18n.t(`Deleted {{name}}`, { name: model.id }));
|
||||
}
|
||||
await models.set(await getModels(localStorage.token));
|
||||
} else {
|
||||
toast.error(
|
||||
$i18n.t('{{ owner }}: You cannot delete this model', {
|
||||
owner: model.owned_by.toUpperCase()
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const cloneModelHandler = async (model) => {
|
||||
|
Loading…
Reference in New Issue
Block a user