Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/composables/queue/useJobList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n'

import { useQueueProgress } from '@/composables/queue/useQueueProgress'
import { st } from '@/i18n'
import { isCloud } from '@/platform/distribution/types'
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
import { useExecutionStore } from '@/stores/executionStore'
import { useQueueStore } from '@/stores/queueStore'
Expand Down Expand Up @@ -257,7 +258,8 @@ export function useJobList() {
totalPercent: isActive ? totalPercent.value : undefined,
currentNodePercent: isActive ? currentNodePercent.value : undefined,
currentNodeName: isActive ? currentNodeName.value : undefined,
showAddedHint
showAddedHint,
isCloud
})

return {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@
"initializingAlmostReady": "Initializing - Almost ready",
"inQueue": "In queue...",
"jobAddedToQueue": "Job added to queue",
"completedIn": "Finished in {duration}",
"jobMenu": {
"openAsWorkflowNewTab": "Open as workflow in new tab",
"openWorkflowNewTab": "Open workflow in new tab",
Expand Down
18 changes: 14 additions & 4 deletions src/utils/queueDisplay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { TaskItemImpl } from '@/stores/queueStore'
import type { JobState } from '@/types/queue'
import { formatDuration } from '@/utils/formatUtil'
import { clampPercentInt, formatPercent0 } from '@/utils/numberUtil'

type BuildJobDisplayCtx = {
Expand All @@ -11,6 +12,8 @@ type BuildJobDisplayCtx = {
currentNodePercent?: number
currentNodeName?: string
showAddedHint?: boolean
/** Whether the app is running in cloud distribution */
isCloud?: boolean
}

type JobDisplay = {
Expand Down Expand Up @@ -122,13 +125,20 @@ export const buildJobDisplay = (
const time = task.executionTimeInSeconds
const preview = task.previewOutput
const iconImageUrl = preview && preview.isImage ? preview.url : undefined

// Cloud shows "Completed in Xh Ym Zs", non-cloud shows filename
const primary = ctx.isCloud
? ctx.t('queue.completedIn', {
duration: formatDuration(task.executionTime ?? 0)
})
: preview?.filename && preview.filename.length
? preview.filename
: buildTitle(task, ctx.t)

return {
iconName: iconForJobState(state),
iconImageUrl,
primary:
preview?.filename && preview.filename.length
? preview.filename
: buildTitle(task, ctx.t),
primary,
secondary: time !== undefined ? `${time.toFixed(2)}s` : '',
showClear: false
}
Expand Down
Loading