11<script setup lang="ts">
22import {ref , Ref } from " vue" ;
3+ import {formatISODate } from " ../../utils/formatting" ;
34import {CollectorConfig , BenchmarkJobStatus } from " ./data" ;
45
56const props = defineProps <{
@@ -26,6 +27,19 @@ const ACTIVE_FILTERS: Ref<Record<BenchmarkJobStatus, boolean>> = ref({
2627function filterJobByStatus(status : string ) {
2728 ACTIVE_FILTERS .value [status ] = ! ACTIVE_FILTERS .value [status ];
2829}
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+ }
2943 </script >
3044
3145<template >
@@ -62,14 +76,14 @@ function filterJobByStatus(status: string) {
6276 <span class =" collector-meta-name" >
6377 <strong >Last Heartbeat:</strong >
6478 </span >
65- <span >{{ collector.lastHeartbeatAt }}</span >
79+ <span >{{ formatISODate( collector.lastHeartbeatAt) }}</span >
6680 </div >
6781
6882 <div class =" collector-meta" >
6983 <span class =" collector-meta-name" >
7084 <strong >Date Added:</strong >
7185 </span >
72- <span >{{ collector.dateAdded }}</span >
86+ <span >{{ formatISODate( collector.dateAdded) }}</span >
7387 </div >
7488 </div >
7589
@@ -83,7 +97,7 @@ function filterJobByStatus(status: string) {
8397 class =" table-collector-status-filter-btn"
8498 @click =" filterJobByStatus(filter)"
8599 >
86- {{ filter }}
100+ {{ formatJobStatus( filter) }}
87101 <input
88102 type =" checkbox"
89103 value =" filter"
@@ -115,10 +129,10 @@ function filterJobByStatus(status: string) {
115129 {{ job.requestTag }}
116130 </td >
117131 <td class =" table-cell-padding" >
118- {{ job.status }}
132+ {{ formatJobStatus( job.status) }}
119133 </td >
120134 <td class =" table-cell-padding" >
121- {{ job.startedAt }}
135+ {{ formatISODate( job.startedAt) }}
122136 </td >
123137 <td class =" table-cell-padding" >{{ job.backend }}</td >
124138 <td class =" table-cell-padding" >{{ job.profile }}</td >
0 commit comments