mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 05:26:11 +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:
@@ -159,7 +159,8 @@ func formatUptime(secs uint64) string {
|
||||
hours := (secs % 86400) / 3600
|
||||
mins := (secs % 3600) / 60
|
||||
if days > 0 {
|
||||
return fmt.Sprintf("%dd %dh %dm", days, hours, mins)
|
||||
// Only show days and hours when uptime is over 1 day (skip minutes for brevity)
|
||||
return fmt.Sprintf("%dd %dh", days, hours)
|
||||
}
|
||||
if hours > 0 {
|
||||
return fmt.Sprintf("%dh %dm", hours, mins)
|
||||
|
||||
Reference in New Issue
Block a user