From f8f27aaf72ff55bd589641c7792e517fbdacab37 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 21 Jun 2025 17:31:01 -0700 Subject: [PATCH] fix failed task tab state binding --- .../dialog/header/ManagerProgressHeader.vue | 36 +++++++++++++++---- src/locales/en/main.json | 4 ++- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/components/dialog/header/ManagerProgressHeader.vue b/src/components/dialog/header/ManagerProgressHeader.vue index 091a619e4..f07eff7f5 100644 --- a/src/components/dialog/header/ManagerProgressHeader.vue +++ b/src/components/dialog/header/ManagerProgressHeader.vue @@ -21,15 +21,37 @@ import TabMenu from 'primevue/tabmenu' import { computed } from 'vue' import { useI18n } from 'vue-i18n' -import { useManagerProgressDialogStore } from '@/stores/comfyManagerStore' +import { + useComfyManagerStore, + useManagerProgressDialogStore +} from '@/stores/comfyManagerStore' const progressDialogContent = useManagerProgressDialogStore() -const activeTabIndex = computed(() => { - return progressDialogContent.getActiveTabIndex() +const comfyManagerStore = useComfyManagerStore() +const activeTabIndex = computed({ + get: () => progressDialogContent.getActiveTabIndex(), + set: (value: number) => progressDialogContent.setActiveTabIndex(value) }) const { t } = useI18n() -const tabs = [ - { label: t('manager.installationQueue') }, - { label: t('manager.failed', { count: 0 }) } -] + +const failedCount = computed(() => comfyManagerStore.failedTasksIds.length) + +const queueSuffix = computed(() => { + const queueLength = comfyManagerStore.managerQueue.queueLength + if (queueLength === 0) { + return '' + } + return ` (${queueLength})` +}) +const failedSuffix = computed(() => { + if (failedCount.value === 0) { + return '' + } + return ` (${failedCount.value})` +}) + +const tabs = computed(() => [ + { label: t('manager.installationQueue') + queueSuffix.value }, + { label: t('manager.failed') + failedSuffix.value } +]) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 2396010a8..b0ca3cbc1 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -139,7 +139,9 @@ "manager": { "title": "Custom Nodes Manager", "legacyMenuNotAvailable": "Legacy manager menu is not available, defaulting to the new manager menu.", - "failed": "Failed ({count})", + "legacyManagerUI": "Use Legacy UI", + "legacyManagerUIDescription": "To use the legacy Manager UI, start ComfyUI with --enable-manager-legacy-ui", + "failed": "Failed", "noNodesFound": "No nodes found", "noNodesFoundDescription": "The pack's nodes either could not be parsed, or the pack is a frontend extension only and doesn't have any nodes.", "installationQueue": "Installation Queue",