Line data Source code
1 : import { markRaw } from 'vue'
2 :
3 : import JobHistorySidebarTab from '@/components/sidebar/tabs/JobHistorySidebarTab.vue'
4 : import { useQueueStore } from '@/stores/queueStore'
5 : import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
6 : import type { SidebarTabExtension } from '@/types/extensionTypes'
7 :
8 2355 : export const useJobHistorySidebarTab = (): SidebarTabExtension => {
9 12 : return {
10 : id: 'job-history',
11 : icon: 'icon-[lucide--history]',
12 : title: 'queue.jobHistory',
13 : tooltip: 'queue.jobHistory',
14 : label: 'queue.jobHistory',
15 : component: markRaw(JobHistorySidebarTab),
16 : type: 'vue',
17 : iconBadge: () => {
18 : const sidebarTabStore = useSidebarTabStore()
19 25 : if (sidebarTabStore.activeSidebarTabId === 'job-history') {
20 9 : return null
21 : }
22 :
23 : const queueStore = useQueueStore()
24 16 : const count = queueStore.activeJobsCount
25 25 : return count > 0 ? count.toString() : null
26 : }
27 : }
28 : }
|