hub v0.1.6: Handle disabled reporting status, storage labels, date in history

This commit is contained in:
2026-02-19 09:45:45 +01:00
parent fa4713255f
commit d3d3044b98
4 changed files with 17 additions and 5 deletions
+8 -2
View File
@@ -140,7 +140,9 @@ func (s *Server) handleDashboard(w http.ResponseWriter, r *http.Request) {
dc := dashboardCustomer{CustomerSummary: c}
// Determine overall status
if c.TimeSinceReport > time.Hour {
if c.HealthStatus == "disabled" {
dc.OverallStatus = "disabled"
} else if c.TimeSinceReport > time.Hour {
dc.OverallStatus = "down"
} else if c.TimeSinceReport > 30*time.Minute || c.HealthStatus == "warn" {
dc.OverallStatus = "warn"
@@ -199,7 +201,9 @@ func (s *Server) handleCustomerDetail(w http.ResponseWriter, r *http.Request, cu
}
overallStatus := "ok"
if customer.TimeSinceReport > time.Hour {
if customer.HealthStatus == "disabled" {
overallStatus = "disabled"
} else if customer.TimeSinceReport > time.Hour {
overallStatus = "down"
} else if customer.TimeSinceReport > 30*time.Minute || customer.HealthStatus == "warn" {
overallStatus = "warn"
@@ -259,6 +263,8 @@ func statusColor(status string) string {
return "#facc15" // yellow
case "down", "fail":
return "#f87171" // red
case "disabled":
return "#94a3b8" // gray
default:
return "#94a3b8" // gray
}