From fc6b3424cf8c3b31a52272b85189af5dec653a3d Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 29 Oct 2025 14:24:17 +0100 Subject: [PATCH] Add hostname to NixOS title and make dashboard title bold - Change system panel title from 'NixOS:' to 'NixOS hostname:' - Make main dashboard title 'cm-dashboard' bold in top bar - Remove unused Typography::title() function to fix warnings - Update SystemWidget::render_with_scroll to accept hostname parameter - Update version to 0.1.41 in all Cargo.toml files and dashboard code --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- dashboard/Cargo.toml | 2 +- dashboard/src/main.rs | 2 +- dashboard/src/ui/mod.rs | 4 ++-- dashboard/src/ui/theme.rs | 6 ------ dashboard/src/ui/widgets/system.rs | 4 ++-- shared/Cargo.toml | 2 +- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f1135f..c110bb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.39" +version = "0.1.40" dependencies = [ "anyhow", "chrono", @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.39" +version = "0.1.40" dependencies = [ "anyhow", "async-trait", @@ -314,7 +314,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.39" +version = "0.1.40" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 821a477..f313bf7 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.40" +version = "0.1.41" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 2df0b01..1365cd3 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.40" +version = "0.1.41" edition = "2021" [dependencies] diff --git a/dashboard/src/main.rs b/dashboard/src/main.rs index 865711a..aae47c9 100644 --- a/dashboard/src/main.rs +++ b/dashboard/src/main.rs @@ -14,7 +14,7 @@ use app::Dashboard; /// Get hardcoded version fn get_version() -> &'static str { - "v0.1.33" + "v0.1.41" } /// Check if running inside tmux session diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index 53e4e0b..56dd39a 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -568,7 +568,7 @@ ssh -tt {}@{} 'bash -ic {}'", // Left side: "cm-dashboard" text let left_span = Span::styled( " cm-dashboard", - Style::default().fg(Theme::background()).bg(background_color) + Style::default().fg(Theme::background()).bg(background_color).add_modifier(Modifier::BOLD) ); let left_title = Paragraph::new(Line::from(vec![left_span])) .style(Style::default().bg(background_color)); @@ -708,7 +708,7 @@ ssh -tt {}@{} 'bash -ic {}'", host_widgets.system_scroll_offset }; let host_widgets = self.get_or_create_host_widgets(&hostname); - host_widgets.system_widget.render_with_scroll(frame, inner_area, scroll_offset); + host_widgets.system_widget.render_with_scroll(frame, inner_area, scroll_offset, &hostname); } } diff --git a/dashboard/src/ui/theme.rs b/dashboard/src/ui/theme.rs index 510ae38..1458655 100644 --- a/dashboard/src/ui/theme.rs +++ b/dashboard/src/ui/theme.rs @@ -292,12 +292,6 @@ impl Components { } impl Typography { - /// Main title style (dashboard header) - pub fn title() -> Style { - Style::default() - .fg(Theme::primary_text()) - .bg(Theme::background()) - } /// Widget title style (panel headers) - bold bright white pub fn widget_title() -> Style { diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index c82c100..2c956a8 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -439,12 +439,12 @@ 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) { + pub fn render_with_scroll(&mut self, frame: &mut Frame, area: Rect, scroll_offset: usize, hostname: &str) { let mut lines = Vec::new(); // NixOS section lines.push(Line::from(vec![ - Span::styled("NixOS:", Typography::widget_title()) + Span::styled(format!("NixOS {}:", hostname), Typography::widget_title()) ])); let build_text = self.nixos_build.as_deref().unwrap_or("unknown"); diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 6927592..2907acb 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.40" +version = "0.1.41" edition = "2021" [dependencies]