This commit is contained in:
2025-10-12 14:58:10 +02:00
parent 2239badc8a
commit 656d410a7a
2 changed files with 171 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ fn render_metrics(
let mut data = WidgetData::new(
title,
Some(WidgetStatus::new(widget_status)),
vec!["Service".to_string(), "Memory".to_string(), "Disk".to_string(), "Description".to_string()]
vec!["Service".to_string(), "Memory".to_string(), "Disk".to_string()]
);
@@ -60,7 +60,6 @@ fn render_metrics(
WidgetValue::new("No services reported"),
WidgetValue::new(""),
WidgetValue::new(""),
WidgetValue::new(""),
],
);
render_widget_data(frame, area, data);
@@ -82,6 +81,7 @@ fn render_metrics(
ServiceStatus::Stopped => StatusLevel::Error,
};
// Main service row
data.add_row(
Some(WidgetStatus::new(status_level)),
"",
@@ -89,9 +89,23 @@ fn render_metrics(
WidgetValue::new(svc.name.clone()),
WidgetValue::new(format_memory_value(svc.memory_used_mb, svc.memory_quota_mb)),
WidgetValue::new(format_disk_value(svc.disk_used_gb)),
WidgetValue::new(svc.description.as_deref().unwrap_or("")),
],
);
// Description row (indented) if description exists
if let Some(description) = &svc.description {
if !description.trim().is_empty() {
data.add_row(
None,
"",
vec![
WidgetValue::new(format!(" {}", description)),
WidgetValue::new(""),
WidgetValue::new(""),
],
);
}
}
}
render_widget_data(frame, area, data);