File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed
site/frontend/src/pages/status_new Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -43,23 +43,31 @@ function ActiveStatus({collector}: {collector: CollectorConfig}) {
4343 const maxInactivityHours = 1 ;
4444 const lastHeartBeatAt = parseISO (collector .lastHeartbeatAt );
4545 const hourDiff = differenceInHours (now , lastHeartBeatAt );
46- let statusText = " Active " ;
47- let statusClass = " active " ;
46+ let statusText = " Waiting " ;
47+ let statusClass = " waiting " ;
4848
4949 switch (collector .isActive ) {
5050 case false :
51+ statusText = " Inactive" ;
52+ statusClass = " inactive" ;
53+ break ;
54+ case true :
5155 if (hourDiff >= maxInactivityHours ) {
5256 statusText = " Offline" ;
5357 statusClass = " offline" ;
5458 } else {
55- statusText = " Active" ;
56- statusClass = " active" ;
59+ const allJobsComplete = collector .jobs .every (
60+ (job ) => job .status === " Failed" || job .status === " Success"
61+ );
62+ if (allJobsComplete || collector .jobs .length === 0 ) {
63+ statusText = " Waiting" ;
64+ statusClass = " waiting" ;
65+ } else {
66+ statusText = " Benchmarking" ;
67+ statusClass = " benchmarking" ;
68+ }
5769 }
5870 break ;
59- case true :
60- statusText = " Inactive" ;
61- statusClass = " inactive" ;
62- break ;
6371 }
6472
6573 return (
@@ -252,11 +260,16 @@ $sm-radius: 8px;
252260.status {
253261}
254262
255- .status.active {
263+ .status.benchmarking {
256264 background : #117411 ;
257265 color : white ;
258266 font-weight : bold ;
259267}
268+ .status.waiting {
269+ background : #1b45e4 ;
270+ color : white ;
271+ font-weight : bold ;
272+ }
260273.status.inactive {
261274 background : #ccc ;
262275 color : white ;
You can’t perform that action at this time.
0 commit comments