mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
Add completed state indicator
This commit is contained in:
parent
d9f9c8aaf5
commit
bf64fc5213
@ -28,6 +28,17 @@
|
|||||||
return `${hours}:${('0' + minutes).slice(-2)}:${('0' + seconds).slice(-2)}`;
|
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>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@ -86,12 +97,7 @@
|
|||||||
<p>
|
<p>
|
||||||
Start: <span class="fw-bold">{(new Date(job.startTime)).toLocaleString()}</span>
|
Start: <span class="fw-bold">{(new Date(job.startTime)).toLocaleString()}</span>
|
||||||
<br/>
|
<br/>
|
||||||
Duration: <span class="fw-bold">{formatDuration(job.duration)}</span>
|
Duration: <span class="fw-bold">{formatDuration(job.duration)}</span> <Badge color="{getStateColor(job.state)}">{job.state}</Badge>
|
||||||
{#if job.state == 'running'}
|
|
||||||
<Badge color="success">running</Badge>
|
|
||||||
{:else if job.state != 'completed'}
|
|
||||||
<Badge color="danger">{job.state}</Badge>
|
|
||||||
{/if}
|
|
||||||
{#if job.walltime}
|
{#if job.walltime}
|
||||||
<br/>
|
<br/>
|
||||||
Walltime: <span class="fw-bold">{formatDuration(job.walltime)}</span>
|
Walltime: <span class="fw-bold">{formatDuration(job.walltime)}</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user