Line data Source code
1 : <template>
2 : <div
3 19 : v-if="shouldShow"
4 : data-testid="queue-inline-progress"
5 : aria-hidden="true"
6 : :class="
7 : cn('pointer-events-none absolute inset-0 overflow-hidden', radiusClass)
8 : "
9 : >
10 : <div
11 : class="pointer-events-none absolute bottom-0 left-0 h-[3px] bg-primary transition-[width]"
12 : :style="{ width: `${totalPercent}%` }"
13 : />
14 : <div
15 : data-testid="queue-inline-progress-node-fill"
16 : class="pointer-events-none absolute bottom-0 left-0 h-[3px] bg-primary/30 transition-[width]"
17 : :style="{ width: `${currentNodePercent}%` }"
18 : />
19 : </div>
20 : </template>
21 :
22 : <script setup lang="ts">
23 : import { computed } from 'vue'
24 :
25 : import { useQueueProgress } from '@/composables/queue/useQueueProgress'
26 : import { cn } from '@comfyorg/tailwind-utils'
27 :
28 : const { hidden = false, radiusClass = 'rounded-[7px]' } = defineProps<{
29 : hidden?: boolean
30 : radiusClass?: string
31 : }>()
32 :
33 12 : const { totalPercent, currentNodePercent } = useQueueProgress()
34 :
35 12 : const shouldShow = computed(
36 : () => !hidden && (totalPercent.value > 0 || currentNodePercent.value > 0)
37 : )
38 : </script>
|