fix(tui): show — for uptime when monitor is in maintenance
Monitors in active maintenance now display — instead of a misleading 0.0% uptime in both the main table and detail sidebar.
This commit was merged in pull request #166.
This commit is contained in:
@@ -104,6 +104,13 @@ func (m Model) fmtLatency(d time.Duration) string {
|
||||
return m.st.dangerStyle.Render(s)
|
||||
}
|
||||
|
||||
func (m Model) fmtUptimeMaint(statuses []bool, siteID int) string {
|
||||
if m.isMonitorInMaintenance(siteID) {
|
||||
return m.st.subtleStyle.Render("—")
|
||||
}
|
||||
return m.fmtUptime(statuses)
|
||||
}
|
||||
|
||||
func (m Model) fmtUptime(statuses []bool) string {
|
||||
if len(statuses) == 0 {
|
||||
return m.st.subtleStyle.Render("—")
|
||||
|
||||
Reference in New Issue
Block a user