mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-22 23:39:45 +00:00
better badges for empty/loading model library folders (#953)
* better badges for empty/loading model library folders for #945 * fix total count on loaded nodes * fix test break * additional test fix * use a null prop fallback instead of having to explicitly calc * patch
This commit is contained in:
committed by
Chenlei Hu
parent
4e5bcd6a3b
commit
d2d645f74b
@@ -137,6 +137,22 @@ const renderedRoot = computed<TreeExplorerNode<ComfyModelDef>>(() => {
|
||||
return 'pi pi-file'
|
||||
}
|
||||
},
|
||||
getBadgeText: (node: TreeExplorerNode<ComfyModelDef>) => {
|
||||
if (node.leaf) {
|
||||
return null
|
||||
}
|
||||
if (node.children?.length === 1) {
|
||||
const onlyChild = node.children[0]
|
||||
if (onlyChild.data?.is_fake_object) {
|
||||
if (onlyChild.data.name === '(No Content)') {
|
||||
return '0'
|
||||
} else if (onlyChild.data.name === 'Loading') {
|
||||
return '?'
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
},
|
||||
children,
|
||||
draggable: node.leaf,
|
||||
handleClick: (
|
||||
|
||||
Reference in New Issue
Block a user