mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 13:59:54 +00:00
fix: centralize active jobs count
This commit is contained in:
@@ -212,6 +212,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDebounceFn, useElementHover, useResizeObserver } from '@vueuse/core'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import Divider from 'primevue/divider'
|
||||
import ProgressSpinner from 'primevue/progressspinner'
|
||||
import { useToast } from 'primevue/usetoast'
|
||||
@@ -256,6 +257,7 @@ interface JobOutputItem {
|
||||
const { t, n } = useI18n()
|
||||
const commandStore = useCommandStore()
|
||||
const queueStore = useQueueStore()
|
||||
const { activeJobsCount } = storeToRefs(queueStore)
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const activeTab = ref<'input' | 'output'>('output')
|
||||
@@ -301,9 +303,6 @@ const formattedExecutionTime = computed(() => {
|
||||
})
|
||||
|
||||
const queuedCount = computed(() => queueStore.pendingTasks.length)
|
||||
const activeJobsCount = computed(
|
||||
() => queueStore.pendingTasks.length + queueStore.runningTasks.length
|
||||
)
|
||||
const activeJobsLabel = computed(() => {
|
||||
const count = activeJobsCount.value
|
||||
return t(
|
||||
|
||||
@@ -493,6 +493,9 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
)
|
||||
|
||||
const hasPendingTasks = computed<boolean>(() => pendingTasks.value.length > 0)
|
||||
const activeJobsCount = computed(
|
||||
() => pendingTasks.value.length + runningTasks.value.length
|
||||
)
|
||||
|
||||
const update = async () => {
|
||||
isLoading.value = true
|
||||
@@ -572,6 +575,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
flatTasks,
|
||||
lastHistoryQueueIndex,
|
||||
hasPendingTasks,
|
||||
activeJobsCount,
|
||||
|
||||
update,
|
||||
clear,
|
||||
|
||||
Reference in New Issue
Block a user