From 997b30a9c003404f336e1b6eb058c72b7976bd96 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 23 Oct 2025 19:34:27 +0200 Subject: [PATCH] Update system widget layout with section headers - Add section headers: CPU, RAM, Storage as plain titles - Remove status icons from section headers - Keep status icons only on data lines (Load, Usage, /tmp, filesystems) - Restore (Single) label for all storage types - Improve visual hierarchy with clear section separation --- dashboard/src/ui/widgets/system.rs | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index 7e10f08..eb8173b 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -254,11 +254,7 @@ impl SystemWidget { _ => "—% —GB/—GB".to_string(), }; - let pool_label = if pool.pool_type.to_lowercase() == "single" { - format!("{}:", pool.mount_point) - } else { - format!("{} ({}):", pool.mount_point, pool.pool_type) - }; + let pool_label = format!("{} ({}):", pool.mount_point, pool.pool_type); let pool_spans = StatusIcons::create_status_spans( pool.status.clone(), &pool_label @@ -421,14 +417,15 @@ impl Widget for SystemWidget { Span::styled(format!("Agent: {}", short_hash), Typography::secondary()) ])); - // Empty line - lines.push(Line::from(vec![Span::raw("")])); - // CPU section + lines.push(Line::from(vec![ + Span::styled("CPU:", Typography::widget_title()) + ])); + let load_text = self.format_cpu_load(); let cpu_spans = StatusIcons::create_status_spans( self.cpu_status.clone(), - &format!("CPU: {}", load_text) + &format!("Load: {}", load_text) ); lines.push(Line::from(cpu_spans)); @@ -439,10 +436,14 @@ impl Widget for SystemWidget { ])); // RAM section + lines.push(Line::from(vec![ + Span::styled("RAM:", Typography::widget_title()) + ])); + let memory_text = self.format_memory_usage(); let memory_spans = StatusIcons::create_status_spans( self.memory_status.clone(), - &format!("RAM: {}", memory_text) + &format!("Usage: {}", memory_text) ); lines.push(Line::from(memory_spans)); @@ -456,10 +457,12 @@ impl Widget for SystemWidget { )); lines.push(Line::from(tmp_spans)); - // Empty line before storage - lines.push(Line::from(vec![Span::raw("")])); - - // Storage section with tree structure + // Storage section + lines.push(Line::from(vec![ + Span::styled("Storage:", Typography::widget_title()) + ])); + + // Storage items lines.extend(self.render_storage()); let paragraph = Paragraph::new(Text::from(lines));