Fix dashboard UI: correct pending color (blue) and use host_status_summary metric
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user