File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ public enum StatusType : byte
66 Up = 1 ,
77 Pending = 2 ,
88 Maintenance = 3 ,
9+ Unknown = 255 ,
910}
Original file line number Diff line number Diff line change @@ -24,19 +24,17 @@ public override async Task<string> GetString(CancellationToken ct)
2424
2525 if ( heartbeat == null )
2626 return "Unknown" ;
27-
28- StatusType status = StatusType . Pending ;
2927
3028 List < List < HeartbeatList > > lists = heartbeat . HeartbeatList . Values . ToList ( ) ;
31- if ( lists . All ( l => l . All ( h => h . Status is StatusType . Up or StatusType . Pending ) ) )
29+ if ( lists . All ( l => ( l . LastOrDefault ( ) ? . Status ?? StatusType . Unknown ) is StatusType . Up or StatusType . Pending ) )
3230 return "OK" ;
3331
34- if ( lists . Any ( l => l . Any ( h => h . Status == StatusType . Maintenance ) ) )
35- return "Maintenance" ;
32+ if ( lists . Any ( l => ( l . LastOrDefault ( ) ? . Status ?? StatusType . Unknown ) == StatusType . Maintenance ) )
33+ return "🔧 Under Maintenance" ;
3634
37- if ( lists . All ( l => l . All ( h => h . Status == StatusType . Down ) ) )
38- return "Down" ;
35+ if ( lists . All ( l => ( l . LastOrDefault ( ) ? . Status ?? StatusType . Unknown ) == StatusType . Down ) )
36+ return "❌ Down" ;
3937
40- return "Degraded" ;
38+ return "⚠️ Degraded" ;
4139 }
4240}
You can’t perform that action at this time.
0 commit comments