diff --git a/Cargo.lock b/Cargo.lock index 2eaf879..63db345 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.167" +version = "0.1.168" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.167" +version = "0.1.168" dependencies = [ "anyhow", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.167" +version = "0.1.168" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 25d2afd..cfad3d1 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.167" +version = "0.1.168" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index e035d48..66e1f29 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.167" +version = "0.1.168" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index 3f4eb15..a972458 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -715,28 +715,18 @@ impl SystemWidget { Span::styled(format!("Agent: {}", agent_version_text), Typography::secondary()) ])); - // Network section - if !self.network_interfaces.is_empty() { - lines.push(Line::from(vec![ - Span::styled("Network:", Typography::widget_title()) - ])); - - let network_lines = self.render_network(); - lines.extend(network_lines); - } - // 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!("Load: {}", load_text) ); lines.push(Line::from(cpu_spans)); - + let freq_text = self.format_cpu_frequency(); lines.push(Line::from(vec![ Span::styled(" └─ ", Typography::tree()), @@ -747,7 +737,7 @@ impl SystemWidget { 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(), @@ -759,16 +749,16 @@ impl SystemWidget { for (i, tmpfs) in self.tmpfs_mounts.iter().enumerate() { let is_last = i == self.tmpfs_mounts.len() - 1; let tree_symbol = if is_last { " └─ " } else { " ├─ " }; - + let usage_text = if tmpfs.total_gb > 0.0 { - format!("{:.0}% {:.1}GB/{:.1}GB", - tmpfs.usage_percent, - tmpfs.used_gb, + format!("{:.0}% {:.1}GB/{:.1}GB", + tmpfs.usage_percent, + tmpfs.used_gb, tmpfs.total_gb) } else { "— —/—".to_string() }; - + let mut tmpfs_spans = vec![ Span::styled(tree_symbol, Typography::tree()), ]; @@ -779,6 +769,16 @@ impl SystemWidget { lines.push(Line::from(tmpfs_spans)); } + // Network section + if !self.network_interfaces.is_empty() { + lines.push(Line::from(vec![ + Span::styled("Network:", Typography::widget_title()) + ])); + + let network_lines = self.render_network(); + lines.extend(network_lines); + } + // Storage section lines.push(Line::from(vec![ Span::styled("Storage:", Typography::widget_title()) diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 3af3a48..b195174 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.167" +version = "0.1.168" edition = "2021" [dependencies]