Skip to content

Commit

Permalink
Add completed state indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Nov 13, 2023
1 parent d9f9c8a commit bf64fc5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions web/frontend/src/joblist/JobInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
return `${hours}:${('0' + minutes).slice(-2)}:${('0' + seconds).slice(-2)}`;
}
function getStateColor(state) {
switch (state) {
case 'running':
return 'success'
case 'completed':
return 'primary'
default:
return 'danger'
}
}
</script>

<div>
Expand Down Expand Up @@ -86,12 +97,7 @@
<p>
Start: <span class="fw-bold">{(new Date(job.startTime)).toLocaleString()}</span>
<br/>
Duration: <span class="fw-bold">{formatDuration(job.duration)}</span>
{#if job.state == 'running'}
<Badge color="success">running</Badge>
{:else if job.state != 'completed'}
<Badge color="danger">{job.state}</Badge>
{/if}
Duration: <span class="fw-bold">{formatDuration(job.duration)}</span> <Badge color="{getStateColor(job.state)}">{job.state}</Badge>
{#if job.walltime}
<br/>
Walltime: <span class="fw-bold">{formatDuration(job.walltime)}</span>
Expand Down

0 comments on commit bf64fc5

Please sign in to comment.