mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
refac
This commit is contained in:
parent
8e3ad45ce4
commit
63b3076d64
1 changed files with 23 additions and 0 deletions
|
|
@ -95,6 +95,29 @@
|
|||
};
|
||||
|
||||
const moveToTopHandler = async (model) => {
|
||||
// find models with position 0 and set them to 1
|
||||
const topModels = _models.filter((m) => m.info?.meta?.position === 0);
|
||||
for (const m of topModels) {
|
||||
let info = m.info;
|
||||
if (!info) {
|
||||
info = {
|
||||
id: m.id,
|
||||
name: m.name,
|
||||
meta: {
|
||||
position: 1
|
||||
},
|
||||
params: {}
|
||||
};
|
||||
}
|
||||
|
||||
info.meta = {
|
||||
...info.meta,
|
||||
position: 1
|
||||
};
|
||||
|
||||
await updateModelById(localStorage.token, info.id, info);
|
||||
}
|
||||
|
||||
let info = model.info;
|
||||
|
||||
if (!info) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue