1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-10 02:04:17 +00:00

feat: add uptime display to status header (#329)

Show system uptime in the header row with a concise format (e.g., "up 1d 5h").
Simplify title from "Mole Status" to "Status" for better fit.
This commit is contained in:
Tw93
2026-01-18 16:52:44 +08:00
parent 72f42a363e
commit 7a5bdac385
3 changed files with 8 additions and 4 deletions

View File

@@ -131,7 +131,7 @@ type cardData struct {
}
func renderHeader(m MetricsSnapshot, errMsg string, animFrame int, termWidth int, catHidden bool) string {
title := titleStyle.Render("Mole Status")
title := titleStyle.Render("Status")
scoreStyle := getScoreStyle(m.HealthScore)
scoreText := subtleStyle.Render("Health ") + scoreStyle.Render(fmt.Sprintf("● %d", m.HealthScore))
@@ -165,6 +165,9 @@ func renderHeader(m MetricsSnapshot, errMsg string, animFrame int, termWidth int
if m.Hardware.OSVersion != "" {
infoParts = append(infoParts, m.Hardware.OSVersion)
}
if m.Uptime != "" {
infoParts = append(infoParts, subtleStyle.Render("up "+m.Uptime))
}
headerLine := title + " " + scoreText + " " + strings.Join(infoParts, " · ")