Fix dashboard UI: correct pending color (blue) and use host_status_summary metric

This commit is contained in:
2025-10-21 19:32:37 +02:00
parent 7ead8ee98a
commit f4b5bb814d
5 changed files with 54 additions and 17 deletions

View File

@@ -128,6 +128,21 @@ impl HostStatusManager {
);
}
/// Get the current host status as a metric for broadcasting to dashboard
pub fn get_host_status_metric(&self) -> Metric {
Metric {
name: "host_status_summary".to_string(),
value: cm_dashboard_shared::MetricValue::String(format!(
"Host aggregated from {} services",
self.service_statuses.len()
)),
status: self.current_host_status,
timestamp: Utc::now().timestamp() as u64,
description: Some("Aggregated host status from all services".to_string()),
unit: None,
}
}
/// Calculate the overall host status based on all service statuses
fn calculate_host_status(&self) -> Status {
if self.service_statuses.is_empty() {