feat(web): clear failed jobs (#5423)

* add clear failed jobs button

* refactor: clean up code

* chore: open api

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Clement Ong 2023-12-05 10:07:20 +08:00 committed by GitHub
parent 933c24ea6f
commit 982183600d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 55 additions and 9 deletions

View file

@ -5,6 +5,7 @@
import Badge from '$lib/components/elements/badge.svelte';
import JobTileButton from './job-tile-button.svelte';
import JobTileStatus from './job-tile-status.svelte';
import Button from '$lib/components/elements/buttons/button.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import {
mdiAlertCircle,
@ -55,12 +56,23 @@
<div class="flex gap-2">
{#if jobCounts.failed > 0}
<Badge color="primary">
{jobCounts.failed.toLocaleString($locale)} failed
<span class="text-sm">
{jobCounts.failed.toLocaleString($locale)} failed
</span>
<Button
size="tiny"
shadow={false}
on:click={() => dispatch('command', { command: JobCommand.ClearFailed, force: false })}
>
<Icon path={mdiClose} size="18" />
</Button>
</Badge>
{/if}
{#if jobCounts.delayed > 0}
{#if jobCounts.delayed > 0 || true}
<Badge color="secondary">
{jobCounts.delayed.toLocaleString($locale)} delayed
<span class="text-sm">
{jobCounts.delayed.toLocaleString($locale)} delayed
</span>
</Badge>
{/if}
</div>