From 41e1be451e7408ed9e859a266f74fa20345a36ed Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 4 Dec 2025 18:47:30 +0100 Subject: [PATCH] Display selected host with brackets in title bar - Change nftables port labels to lowercase 'wan tcp:' and 'wan udp:' - Add brackets around selected host in title bar for clarity --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- agent/src/collectors/systemd.rs | 4 ++-- dashboard/Cargo.toml | 2 +- dashboard/src/ui/mod.rs | 16 +++++++++++++++- shared/Cargo.toml | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d79211d..1a8f79d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.255" +version = "0.1.256" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.255" +version = "0.1.256" dependencies = [ "anyhow", "async-trait", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.255" +version = "0.1.256" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 4ac329f..c1494db 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.256" +version = "0.1.257" edition = "2021" [dependencies] diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index a34b573..0911944 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -186,7 +186,7 @@ impl SystemdCollector { if !tcp_ports.is_empty() { let metrics = Vec::new(); sub_services.push(SubServiceData { - name: format!("TCP: {}", tcp_ports), + name: format!("wan tcp: {}", tcp_ports), service_status: Status::Info, metrics, service_type: "firewall_port".to_string(), @@ -196,7 +196,7 @@ impl SystemdCollector { if !udp_ports.is_empty() { let metrics = Vec::new(); sub_services.push(SubServiceData { - name: format!("UDP: {}", udp_ports), + name: format!("wan udp: {}", udp_ports), service_status: Status::Info, metrics, service_type: "firewall_port".to_string(), diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 14b5353..5510c91 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.256" +version = "0.1.257" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index d767263..4ea78ac 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -556,7 +556,14 @@ impl TuiApp { )); if Some(host) == self.current_host.as_ref() { - // Selected host in bold background color against status background + // Selected host with brackets in bold background color against status background + host_spans.push(Span::styled( + "[", + Style::default() + .fg(Theme::background()) + .bg(background_color) + .add_modifier(Modifier::BOLD), + )); host_spans.push(Span::styled( host.clone(), Style::default() @@ -564,6 +571,13 @@ impl TuiApp { .bg(background_color) .add_modifier(Modifier::BOLD), )); + host_spans.push(Span::styled( + "]", + Style::default() + .fg(Theme::background()) + .bg(background_color) + .add_modifier(Modifier::BOLD), + )); } else { // Other hosts in normal background color against status background host_spans.push(Span::styled( diff --git a/shared/Cargo.toml b/shared/Cargo.toml index b61329f..58a55c0 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.256" +version = "0.1.257" edition = "2021" [dependencies]