Show node by frequency on empty query (#878)

This commit is contained in:
Chenlei Hu
2024-09-19 09:35:22 +09:00
committed by GitHub
parent efa2fa269d
commit 6c4143ca94
8 changed files with 2711 additions and 8 deletions

View File

@@ -33,6 +33,11 @@
:value="$t('deprecated')"
severity="danger"
/>
<Tag
v-if="showNodeFrequency && nodeFrequency > 0"
:value="formatNumberWithSuffix(nodeFrequency, { roundToInt: true })"
severity="secondary"
/>
<NodeSourceChip
v-if="nodeDef.python_module !== undefined"
:python_module="nodeDef.python_module"
@@ -44,11 +49,12 @@
<script setup lang="ts">
import Tag from 'primevue/tag'
import NodeSourceChip from '@/components/node/NodeSourceChip.vue'
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
import { ComfyNodeDefImpl, useNodeFrequencyStore } from '@/stores/nodeDefStore'
import { highlightQuery } from '@/utils/formatUtil'
import { computed } from 'vue'
import { useSettingStore } from '@/stores/settingStore'
import { useNodeBookmarkStore } from '@/stores/nodeBookmarkStore'
import { formatNumberWithSuffix } from '@/utils/formatUtil'
const settingStore = useSettingStore()
const showCategory = computed(() =>
@@ -57,6 +63,13 @@ const showCategory = computed(() =>
const showIdName = computed(() =>
settingStore.get('Comfy.NodeSearchBoxImpl.ShowIdName')
)
const showNodeFrequency = computed(() =>
settingStore.get('Comfy.NodeSearchBoxImpl.ShowNodeFrequency')
)
const nodeFrequencyStore = useNodeFrequencyStore()
const nodeFrequency = computed(() =>
nodeFrequencyStore.getNodeFrequency(props.nodeDef)
)
const nodeBookmarkStore = useNodeBookmarkStore()
const isBookmarked = computed(() =>