Add completed state indicator

This commit is contained in:
Christoph Kluge 2023-11-13 13:43:44 +01:00
parent d9f9c8aaf5
commit bf64fc5213

View File

@ -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>