mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 21:05:19 +00:00
refac: model selector
This commit is contained in:
parent
5fe588b480
commit
79afb7afdb
1 changed files with 20 additions and 0 deletions
|
|
@ -90,6 +90,26 @@
|
|||
}
|
||||
);
|
||||
|
||||
const updateFuse = () => {
|
||||
if (fuse) {
|
||||
fuse.setCollection(
|
||||
items.map((item) => {
|
||||
const _item = {
|
||||
...item,
|
||||
modelName: item.model?.name,
|
||||
tags: (item.model?.tags ?? []).map((tag) => tag.name).join(' '),
|
||||
desc: item.model?.info?.meta?.description
|
||||
};
|
||||
return _item;
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
$: if (items) {
|
||||
updateFuse();
|
||||
}
|
||||
|
||||
$: filteredItems = (
|
||||
searchValue
|
||||
? fuse
|
||||
|
|
|
|||
Loading…
Reference in a new issue