fix(tui): show — for uptime when monitor is in maintenance
CI / test (pull_request) Successful in 1m57s
CI / lint (pull_request) Successful in 1m27s
CI / vulncheck (pull_request) Successful in 55s

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:
2026-06-30 21:33:39 -04:00
parent 6e936ecce3
commit f7303c946c
3 changed files with 13 additions and 2 deletions
+7
View File
@@ -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("—")