fix: canceled jobs button reporting 0 jobs cancelled (#4534)

This commit is contained in:
wendrul
2024-10-16 16:15:25 +02:00
committed by GitHub
parent 42f8e457fe
commit a51cbc9e08
3 changed files with 10 additions and 1 deletions
+2
View File
@@ -1469,6 +1469,8 @@ async fn cancel_jobs(
}
}
uuids.extend(trivial_jobs);
Ok(Json(uuids))
}
@@ -94,6 +94,10 @@
<Badge color="blue" baseClass="!px-1.5">
<Calendar size={14} />
</Badge>
{:else if job.canceled}
<Badge color="red" baseClass="!px-1.5">
<Hourglass size={14} />
</Badge>
{:else}
<Badge baseClass="!px-1.5">
<Hourglass size={14} />
@@ -120,6 +124,9 @@
{/if}
{:else if `scheduled_for` in job && job.scheduled_for && forLater(job.scheduled_for)}
Scheduled for {displayDate(job.scheduled_for)}
{:else if job.canceled}
Cancelling job... (created <TimeAgo agoOnlyIfRecent date={job.created_at || ''} />)
{:else}
Waiting for executor (created <TimeAgo agoOnlyIfRecent date={job.created_at || ''} />)
{/if}
@@ -497,7 +497,7 @@
}
function isJobCancelable(j: Job): boolean {
return j.type === 'QueuedJob' && !j.schedule_path
return j.type === 'QueuedJob' && !j.schedule_path && !j.canceled
}
function jobCountString(count: number) {