From 783d233319c097704ae2a8eec1e41a97ceb6b5e2 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 28 Oct 2025 23:12:09 +0100 Subject: [PATCH] Add CM Dashboard ASCII logo to rebuild tmux popup - Display branded CM Dashboard ASCII logo in green when rebuild starts - Shows logo immediately when tmux popup opens for better UX - Includes rebuild target hostname and visual separator - Enhances rebuild process with professional branding - Bump version to v0.1.39 --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- dashboard/Cargo.toml | 2 +- dashboard/src/ui/mod.rs | 23 +++++++++++++++++++---- shared/Cargo.toml | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a4204f..b4ccd61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.37" +version = "0.1.38" dependencies = [ "anyhow", "chrono", @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.37" +version = "0.1.38" dependencies = [ "anyhow", "async-trait", @@ -314,7 +314,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.37" +version = "0.1.38" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 9028566..d1f9dea 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.38" +version = "0.1.39" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 0160183..250e1bb 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.38" +version = "0.1.39" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index e24c91d..21c0dc8 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -244,16 +244,31 @@ impl TuiApp { KeyCode::Char('r') => { // System rebuild command - works on any panel for current host if let Some(hostname) = self.current_host.clone() { - // Launch tmux popup with SSH using config values - let ssh_command = format!( - "ssh -tt {}@{} 'bash -ic {}'", + // Create command that shows CM Dashboard logo and then rebuilds + let logo_and_rebuild = format!( + "echo ''; \ + echo -e '\\033[1;32m _____ __ __ _____ _ _ _ \\033[0m'; \ + echo -e '\\033[1;32m / ____| \\/ | | __ \\ | | | | | |\\033[0m'; \ + echo -e '\\033[1;32m| | | \\ / | | | | | __ _ ___| |__ | |__ ___ __ _ _ __ __| |\\033[0m'; \ + echo -e '\\033[1;32m| | | |\\/| | | | | |/ _` / __| \\'_ \\| \\'_ \\ / _ \\ / _` | \\'__/ _` |\\033[0m'; \ + echo -e '\\033[1;32m| |____| | | | | |__| | (_| \\__ \\ | | | |_) | (_) | (_| | | | (_| |\\033[0m'; \ + echo -e '\\033[1;32m \\_____|_| |_| |_____/ \\__,_|___/_| |_|_.__/ \\___/ \\__,_|_| \\__,_|\\033[0m'; \ + echo ''; \ + echo -e '\\033[1;33m NixOS System Rebuild\\033[0m'; \ + echo -e '\\033[1;32m Target: {}\\033[0m'; \ + echo ''; \ + echo -e '\\033[1;90m────────────────────────────────────────────────────────────────────────────────\\033[0m'; \ + echo ''; \ + ssh -tt {}@{} 'bash -ic {}'", + hostname, self.config.ssh.rebuild_user, hostname, self.config.ssh.rebuild_alias ); + std::process::Command::new("tmux") .arg("display-popup") - .arg(&ssh_command) + .arg(&logo_and_rebuild) .spawn() .ok(); // Ignore errors, tmux will handle them } diff --git a/shared/Cargo.toml b/shared/Cargo.toml index fe088f0..6a131f0 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.38" +version = "0.1.39" edition = "2021" [dependencies]