diff --git a/Cargo.lock b/Cargo.lock index 6334380..e7e640d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.66" +version = "0.1.67" dependencies = [ "anyhow", "chrono", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.66" +version = "0.1.67" dependencies = [ "anyhow", "async-trait", @@ -315,7 +315,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.66" +version = "0.1.67" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 41d7383..5cd0dbd 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.67" +version = "0.1.68" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 6d74406..99d4726 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.67" +version = "0.1.68" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index c3f9489..fbee6f3 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -829,8 +829,10 @@ impl TuiApp { let host_widgets = self.get_or_create_host_widgets(&hostname); host_widgets.system_scroll_offset }; + // Clone the config to avoid borrowing issues + let config = self.config.clone(); let host_widgets = self.get_or_create_host_widgets(&hostname); - host_widgets.system_widget.render_with_scroll(frame, inner_area, scroll_offset, &hostname); + host_widgets.system_widget.render_with_scroll(frame, inner_area, scroll_offset, &hostname, Some(&config)); } } diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index 2c956a8..a10bf8d 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -439,7 +439,7 @@ impl Widget for SystemWidget { impl SystemWidget { /// Render with scroll offset support - pub fn render_with_scroll(&mut self, frame: &mut Frame, area: Rect, scroll_offset: usize, hostname: &str) { + pub fn render_with_scroll(&mut self, frame: &mut Frame, area: Rect, scroll_offset: usize, hostname: &str, config: Option<&crate::config::DashboardConfig>) { let mut lines = Vec::new(); // NixOS section @@ -457,6 +457,16 @@ impl SystemWidget { Span::styled(format!("Agent: {}", agent_version_text), Typography::secondary()) ])); + // Display detected connection IP + if let Some(config) = config { + if let Some(host_details) = config.hosts.get(hostname) { + let detected_ip = host_details.get_connection_ip(hostname); + lines.push(Line::from(vec![ + Span::styled(format!("IP: {}", detected_ip), Typography::secondary()) + ])); + } + } + // CPU section lines.push(Line::from(vec![ diff --git a/shared/Cargo.toml b/shared/Cargo.toml index a3590bc..fb461ed 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.67" +version = "0.1.68" edition = "2021" [dependencies]