mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-07-02 20:59:24 +08:00
sort type and base
This commit is contained in:
parent
44ed919218
commit
b4b6e3d4d8
@ -555,27 +555,46 @@ export class ModelManager {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.typeList = [{
|
const typeList = [];
|
||||||
label: "All",
|
|
||||||
value: ""
|
|
||||||
}];
|
|
||||||
typeMap.forEach(type => {
|
typeMap.forEach(type => {
|
||||||
this.typeList.push({
|
typeList.push({
|
||||||
label: type,
|
label: type,
|
||||||
value: type
|
value: type
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
typeList.sort((a,b)=> {
|
||||||
this.baseList = [{
|
const au = a.label.toUpperCase();
|
||||||
|
const bu = b.label.toUpperCase();
|
||||||
|
if (au !== bu) {
|
||||||
|
return au > bu ? 1 : -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
this.typeList = [{
|
||||||
label: "All",
|
label: "All",
|
||||||
value: ""
|
value: ""
|
||||||
}];
|
}].concat(typeList);
|
||||||
|
|
||||||
|
|
||||||
|
const baseList = [];
|
||||||
baseMap.forEach(base => {
|
baseMap.forEach(base => {
|
||||||
this.baseList.push({
|
baseList.push({
|
||||||
label: base,
|
label: base,
|
||||||
value: base
|
value: base
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
baseList.sort((a,b)=> {
|
||||||
|
const au = a.label.toUpperCase();
|
||||||
|
const bu = b.label.toUpperCase();
|
||||||
|
if (au !== bu) {
|
||||||
|
return au > bu ? 1 : -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
this.baseList = [{
|
||||||
|
label: "All",
|
||||||
|
value: ""
|
||||||
|
}].concat(baseList);
|
||||||
|
|
||||||
return models;
|
return models;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user