1
1
<script setup lang="ts">
2
2
import {ref , Ref } from " vue" ;
3
+ import {formatISODate } from " ../../utils/formatting" ;
3
4
import {CollectorConfig , BenchmarkJobStatus } from " ./data" ;
4
5
5
6
const props = defineProps <{
@@ -26,6 +27,19 @@ const ACTIVE_FILTERS: Ref<Record<BenchmarkJobStatus, boolean>> = ref({
26
27
function filterJobByStatus(status : string ) {
27
28
ACTIVE_FILTERS .value [status ] = ! ACTIVE_FILTERS .value [status ];
28
29
}
30
+
31
+ function formatJobStatus(status : BenchmarkJobStatus ): string {
32
+ switch (status ) {
33
+ case " InProgress" :
34
+ return " In progress" ;
35
+ case " Success" :
36
+ case " Failed" :
37
+ case " Queued" :
38
+ return status ;
39
+ default :
40
+ return " Unknown" ;
41
+ }
42
+ }
29
43
</script >
30
44
31
45
<template >
@@ -62,14 +76,14 @@ function filterJobByStatus(status: string) {
62
76
<span class =" collector-meta-name" >
63
77
<strong >Last Heartbeat:</strong >
64
78
</span >
65
- <span >{{ collector.lastHeartbeatAt }}</span >
79
+ <span >{{ formatISODate( collector.lastHeartbeatAt) }}</span >
66
80
</div >
67
81
68
82
<div class =" collector-meta" >
69
83
<span class =" collector-meta-name" >
70
84
<strong >Date Added:</strong >
71
85
</span >
72
- <span >{{ collector.dateAdded }}</span >
86
+ <span >{{ formatISODate( collector.dateAdded) }}</span >
73
87
</div >
74
88
</div >
75
89
@@ -83,7 +97,7 @@ function filterJobByStatus(status: string) {
83
97
class =" table-collector-status-filter-btn"
84
98
@click =" filterJobByStatus(filter)"
85
99
>
86
- {{ filter }}
100
+ {{ formatJobStatus( filter) }}
87
101
<input
88
102
type =" checkbox"
89
103
value =" filter"
@@ -115,10 +129,10 @@ function filterJobByStatus(status: string) {
115
129
{{ job.requestTag }}
116
130
</td >
117
131
<td class =" table-cell-padding" >
118
- {{ job.status }}
132
+ {{ formatJobStatus( job.status) }}
119
133
</td >
120
134
<td class =" table-cell-padding" >
121
- {{ job.startedAt }}
135
+ {{ formatISODate( job.startedAt) }}
122
136
</td >
123
137
<td class =" table-cell-padding" >{{ job.backend }}</td >
124
138
<td class =" table-cell-padding" >{{ job.profile }}</td >
0 commit comments