Remove question mark badge on folders in model library tree (#1205)

This commit is contained in:
Chenlei Hu
2024-10-10 10:13:14 -04:00
committed by GitHub
parent 8962597e69
commit 4413fd248c
3 changed files with 15 additions and 4 deletions

View File

@@ -21,8 +21,8 @@
<slot name="after-label" :node="props.node"></slot>
</span>
<Badge
v-if="!props.node.leaf"
:value="props.node.badgeText ?? props.node.totalLeaves"
v-if="showNodeBadgeText"
:value="nodeBadgeText"
severity="secondary"
class="leaf-count-badge"
/>
@@ -62,6 +62,17 @@ const emit = defineEmits<{
(e: 'dragEnd', node: RenderedTreeExplorerNode): void
}>()
const nodeBadgeText = computed<string>(() => {
if (props.node.leaf) {
return ''
}
if (props.node.badgeText !== undefined && props.node.badgeText !== null) {
return props.node.badgeText
}
return props.node.totalLeaves.toString()
})
const showNodeBadgeText = computed<boolean>(() => nodeBadgeText.value !== '')
const labelEditable = computed<boolean>(() => !!props.node.handleRename)
const renameEditingNode =
inject<Ref<TreeExplorerNode | null>>('renameEditingNode')

View File

@@ -154,7 +154,7 @@ const renderedRoot = computed<TreeExplorerNode<ComfyModelDef>>(() => {
if (onlyChild.data.file_name === '(No Content)') {
return '0'
} else if (onlyChild.data.file_name === 'Loading') {
return '?'
return ''
}
}
}