feat(tui): 30-day uptime timeline in inline detail panel

Statuspage-style colored bar — one █ per day, colored by uptime:
green (>= 99%), yellow (>= 95%), red (< 95%), gray (no data).
30-day percentage shown to the right.

Daily breakdown computed via ComputeDailyBreakdown from state_changes
and loaded alongside detail data in loadDetailCmd. Auto-updates on
cursor move.
This commit is contained in:
2026-06-24 20:16:01 -04:00
parent 6799163cd4
commit a59edf8410
6 changed files with 78 additions and 4 deletions
+4 -2
View File
@@ -4,6 +4,7 @@ import (
"time"
"gitea.lerkolabs.com/lerkolabs/uptop/internal/models"
"gitea.lerkolabs.com/lerkolabs/uptop/internal/monitor"
)
// tabRefreshTTL bounds how often the DB-backed tab data (alerts, users, nodes,
@@ -34,8 +35,9 @@ type tabDataMsg struct {
// on entry and refreshed on the tab-data cadence so View never touches the
// database.
type detailDataMsg struct {
siteID int
changes []models.StateChange
siteID int
changes []models.StateChange
dailyDays []monitor.DayReport
}
// historyDataMsg carries the full state-change history for the history view.