diff --git a/hub/internal/web/server.go b/hub/internal/web/server.go index d1da221..bf50c68 100644 --- a/hub/internal/web/server.go +++ b/hub/internal/web/server.go @@ -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 } diff --git a/hub/internal/web/templates/customer.html b/hub/internal/web/templates/customer.html index 57d756f..4f66a91 100644 --- a/hub/internal/web/templates/customer.html +++ b/hub/internal/web/templates/customer.html @@ -62,7 +62,7 @@
{{range .}}
- {{index . "mount"}} + {{with index . "label"}}{{.}}{{else}}{{index . "mount"}}{{end}} {{printf "%.0f" (index . "percent")}}%
{{printf "%.1f" (index . "used_gb")}} / {{printf "%.1f" (index . "total_gb")}} GB @@ -130,6 +130,10 @@

Health

+ {{if eq .OverallStatus "disabled"}} +

Reporting has been disabled on this node

+

Enable it in the controller's controller.yaml: hub.enabled: true

+ {{else}} {{with .Report.health}}

Status: {{index . "status"}} @@ -153,6 +157,7 @@ {{end}} {{end}} + {{end}}

@@ -213,7 +218,7 @@ {{range .History}} - {{.ReceivedAt.Format "15:04:05"}} + {{.ReceivedAt.Format "Jan 02 15:04"}} {{.HealthStatus}} {{formatFloat .CPUPercent}}% {{formatFloat .MemoryPercent}}% diff --git a/hub/internal/web/templates/dashboard.html b/hub/internal/web/templates/dashboard.html index d8cab27..f8936a8 100644 --- a/hub/internal/web/templates/dashboard.html +++ b/hub/internal/web/templates/dashboard.html @@ -43,7 +43,7 @@ - {{if eq .OverallStatus "ok"}}OK{{else if eq .OverallStatus "warn"}}WARN{{else}}DOWN{{end}} + {{if eq .OverallStatus "ok"}}OK{{else if eq .OverallStatus "warn"}}WARN{{else if eq .OverallStatus "disabled"}}PAUSED{{else}}DOWN{{end}} {{timeAgo .ReceivedAt}} diff --git a/hub/internal/web/templates/style.css b/hub/internal/web/templates/style.css index bd52c6a..a6eb63b 100644 --- a/hub/internal/web/templates/style.css +++ b/hub/internal/web/templates/style.css @@ -124,6 +124,7 @@ header h1 { .status-badge-ok { background: rgba(74, 222, 128, 0.15); color: var(--green); } .status-badge-warn { background: rgba(250, 204, 21, 0.15); color: var(--yellow); } .status-badge-down, .status-badge-fail { background: rgba(248, 113, 113, 0.15); color: var(--red); } +.status-badge-disabled { background: #475569; color: #e2e8f0; } /* Cards */ .card {