Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34a1f7b9dc | |||
| d11aa11f99 |
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.75"
|
version = "0.1.77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -292,7 +292,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.75"
|
version = "0.1.77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -315,7 +315,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.75"
|
version = "0.1.77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.76"
|
version = "0.1.78"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ impl Collector for BackupCollector {
|
|||||||
name: "backup_overall_status".to_string(),
|
name: "backup_overall_status".to_string(),
|
||||||
value: MetricValue::String(match overall_status {
|
value: MetricValue::String(match overall_status {
|
||||||
Status::Ok => "ok".to_string(),
|
Status::Ok => "ok".to_string(),
|
||||||
|
Status::Inactive => "inactive".to_string(),
|
||||||
Status::Pending => "pending".to_string(),
|
Status::Pending => "pending".to_string(),
|
||||||
Status::Warning => "warning".to_string(),
|
Status::Warning => "warning".to_string(),
|
||||||
Status::Critical => "critical".to_string(),
|
Status::Critical => "critical".to_string(),
|
||||||
@@ -199,6 +200,7 @@ impl Collector for BackupCollector {
|
|||||||
name: format!("backup_service_{}_status", service_name),
|
name: format!("backup_service_{}_status", service_name),
|
||||||
value: MetricValue::String(match service_status {
|
value: MetricValue::String(match service_status {
|
||||||
Status::Ok => "ok".to_string(),
|
Status::Ok => "ok".to_string(),
|
||||||
|
Status::Inactive => "inactive".to_string(),
|
||||||
Status::Pending => "pending".to_string(),
|
Status::Pending => "pending".to_string(),
|
||||||
Status::Warning => "warning".to_string(),
|
Status::Warning => "warning".to_string(),
|
||||||
Status::Critical => "critical".to_string(),
|
Status::Critical => "critical".to_string(),
|
||||||
|
|||||||
@@ -372,7 +372,8 @@ impl SystemdCollector {
|
|||||||
debug!("Service '{}' is inactive but marked as user-stopped - treating as OK", service_name);
|
debug!("Service '{}' is inactive but marked as user-stopped - treating as OK", service_name);
|
||||||
Status::Ok
|
Status::Ok
|
||||||
} else {
|
} else {
|
||||||
Status::Warning
|
debug!("Service '{}' is inactive - treating as Inactive status", service_name);
|
||||||
|
Status::Inactive
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"failed" | "error" => Status::Critical,
|
"failed" | "error" => Status::Critical,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.76"
|
version = "0.1.78"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -718,6 +718,7 @@ impl TuiApp {
|
|||||||
Status::Warning => has_warning = true,
|
Status::Warning => has_warning = true,
|
||||||
Status::Pending => has_pending = true,
|
Status::Pending => has_pending = true,
|
||||||
Status::Ok => ok_count += 1,
|
Status::Ok => ok_count += 1,
|
||||||
|
Status::Inactive => ok_count += 1, // Treat inactive as OK for aggregation
|
||||||
Status::Unknown => {}, // Ignore unknown for aggregation
|
Status::Unknown => {}, // Ignore unknown for aggregation
|
||||||
Status::Offline => {}, // Ignore offline for aggregation
|
Status::Offline => {}, // Ignore offline for aggregation
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ impl Theme {
|
|||||||
pub fn status_color(status: Status) -> Color {
|
pub fn status_color(status: Status) -> Color {
|
||||||
match status {
|
match status {
|
||||||
Status::Ok => Self::success(),
|
Status::Ok => Self::success(),
|
||||||
|
Status::Inactive => Self::muted_text(), // Gray for inactive services
|
||||||
Status::Pending => Self::highlight(), // Blue for pending
|
Status::Pending => Self::highlight(), // Blue for pending
|
||||||
Status::Warning => Self::warning(),
|
Status::Warning => Self::warning(),
|
||||||
Status::Critical => Self::error(),
|
Status::Critical => Self::error(),
|
||||||
@@ -243,6 +244,7 @@ impl StatusIcons {
|
|||||||
pub fn get_icon(status: Status) -> &'static str {
|
pub fn get_icon(status: Status) -> &'static str {
|
||||||
match status {
|
match status {
|
||||||
Status::Ok => "●",
|
Status::Ok => "●",
|
||||||
|
Status::Inactive => "○", // Empty circle for inactive services
|
||||||
Status::Pending => "◉", // Hollow circle for pending
|
Status::Pending => "◉", // Hollow circle for pending
|
||||||
Status::Warning => "◐",
|
Status::Warning => "◐",
|
||||||
Status::Critical => "!",
|
Status::Critical => "!",
|
||||||
@@ -256,6 +258,7 @@ impl StatusIcons {
|
|||||||
let icon = Self::get_icon(status);
|
let icon = Self::get_icon(status);
|
||||||
let status_color = match status {
|
let status_color = match status {
|
||||||
Status::Ok => Theme::success(), // Green
|
Status::Ok => Theme::success(), // Green
|
||||||
|
Status::Inactive => Theme::muted_text(), // Gray for inactive services
|
||||||
Status::Pending => Theme::highlight(), // Blue
|
Status::Pending => Theme::highlight(), // Blue
|
||||||
Status::Warning => Theme::warning(), // Yellow
|
Status::Warning => Theme::warning(), // Yellow
|
||||||
Status::Critical => Theme::error(), // Red
|
Status::Critical => Theme::error(), // Red
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ impl ServicesWidget {
|
|||||||
let icon = StatusIcons::get_icon(info.widget_status);
|
let icon = StatusIcons::get_icon(info.widget_status);
|
||||||
let status_color = match info.widget_status {
|
let status_color = match info.widget_status {
|
||||||
Status::Ok => Theme::success(),
|
Status::Ok => Theme::success(),
|
||||||
|
Status::Inactive => Theme::muted_text(),
|
||||||
Status::Pending => Theme::highlight(),
|
Status::Pending => Theme::highlight(),
|
||||||
Status::Warning => Theme::warning(),
|
Status::Warning => Theme::warning(),
|
||||||
Status::Critical => Theme::error(),
|
Status::Critical => Theme::error(),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.76"
|
version = "0.1.78"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -83,11 +83,12 @@ impl MetricValue {
|
|||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub enum Status {
|
pub enum Status {
|
||||||
Ok,
|
Ok,
|
||||||
|
Inactive, // Same priority as Ok for aggregation
|
||||||
|
Unknown,
|
||||||
|
Offline,
|
||||||
Pending,
|
Pending,
|
||||||
Warning,
|
Warning,
|
||||||
Critical,
|
Critical,
|
||||||
Unknown,
|
|
||||||
Offline,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Status {
|
impl Status {
|
||||||
@@ -181,6 +182,16 @@ impl HysteresisThresholds {
|
|||||||
Status::Ok
|
Status::Ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Status::Inactive => {
|
||||||
|
// Inactive services use normal thresholds like first measurement
|
||||||
|
if value >= self.critical_high {
|
||||||
|
Status::Critical
|
||||||
|
} else if value >= self.warning_high {
|
||||||
|
Status::Warning
|
||||||
|
} else {
|
||||||
|
Status::Ok
|
||||||
|
}
|
||||||
|
}
|
||||||
Status::Pending => {
|
Status::Pending => {
|
||||||
// Service transitioning, use normal thresholds like first measurement
|
// Service transitioning, use normal thresholds like first measurement
|
||||||
if value >= self.critical_high {
|
if value >= self.critical_high {
|
||||||
|
|||||||
Reference in New Issue
Block a user