Add Status::Info for informational sub-services
All checks were successful
Build and Release / build-and-release (push) Successful in 1m9s

Agent uses Status enum to control display:
- Status::Info: no icon, no status text (VPN IP)
- Other statuses: icon + text (containers, nginx sites)

Dashboard checks status, no hardcoded service_type exceptions.

Version: v0.1.237
This commit is contained in:
2025-12-01 15:11:16 +01:00
parent 966ba27b1e
commit 47ab1e387d
8 changed files with 33 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard"
version = "0.1.236"
version = "0.1.237"
edition = "2021"
[dependencies]

View File

@@ -142,6 +142,7 @@ impl Theme {
/// Get color for status level
pub fn status_color(status: Status) -> Color {
match status {
Status::Info => Self::muted_text(), // Gray for informational data
Status::Ok => Self::success(),
Status::Inactive => Self::muted_text(), // Gray for inactive services in service list
Status::Pending => Self::highlight(), // Blue for pending
@@ -240,6 +241,7 @@ impl StatusIcons {
/// Get status icon symbol
pub fn get_icon(status: Status) -> &'static str {
match status {
Status::Info => "", // No icon for informational data
Status::Ok => "",
Status::Inactive => "", // Empty circle for inactive services
Status::Pending => "", // Hollow circle for pending
@@ -254,6 +256,7 @@ impl StatusIcons {
pub fn create_status_spans(status: Status, text: &str) -> Vec<ratatui::text::Span<'static>> {
let icon = Self::get_icon(status);
let status_color = match status {
Status::Info => Theme::muted_text(), // Gray for info
Status::Ok => Theme::success(), // Green
Status::Inactive => Theme::muted_text(), // Gray for inactive services
Status::Pending => Theme::highlight(), // Blue

View File

@@ -156,6 +156,7 @@ impl ServicesWidget {
// Convert Status enum to display text
let status_str = match info.widget_status {
Status::Info => "", // Shouldn't happen for parent services
Status::Ok => "active",
Status::Inactive => "inactive",
Status::Critical => "failed",
@@ -239,6 +240,7 @@ impl ServicesWidget {
// Get status icon and text
let icon = StatusIcons::get_icon(info.widget_status);
let status_color = match info.widget_status {
Status::Info => Theme::muted_text(),
Status::Ok => Theme::success(),
Status::Inactive => Theme::muted_text(),
Status::Pending => Theme::highlight(),
@@ -259,6 +261,7 @@ impl ServicesWidget {
} else {
// Convert Status enum to display text for sub-services
match info.widget_status {
Status::Info => "",
Status::Ok => "active",
Status::Inactive => "inactive",
Status::Critical => "failed",
@@ -298,8 +301,8 @@ impl ServicesWidget {
.bg(Theme::background()),
),
]
} else if info.service_type == "vpn_route" {
// VPN route info - no status icon
} else if info.widget_status == Status::Info {
// Informational data - no status icon
vec![
// Indentation and tree prefix
ratatui::text::Span::styled(