From 520af41a523413dbf3e3071768223e7cb13522aa Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 17 Mar 2026 12:04:52 +0000 Subject: [PATCH] feat: colorful progress output with icons and SSH command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Progress callbacks from kickstart now show: ◆ 78:55:36:08:35:14 partitioning -- preparing disk layout ◆◆◆ 78:55:36:08:35:14 post-install -- configuring system ✔ 78:55:36:08:35:14 complete -- ready at 10.0.1.88 ssh michal@10.0.1.88 Co-Authored-By: Claude Opus 4.6 (1M context) --- bastion/src/bastion/src/routes/api.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bastion/src/bastion/src/routes/api.ts b/bastion/src/bastion/src/routes/api.ts index 9647893..be4ae3c 100644 --- a/bastion/src/bastion/src/routes/api.ts +++ b/bastion/src/bastion/src/routes/api.ts @@ -72,7 +72,18 @@ export function registerApiRoutes( const stageName = stage ?? "unknown"; const detailStr = detail ?? ""; - logger.info(`Progress: ${mac} ${stageName}${detailStr ? ` -- ${detailStr}` : ""}`); + const GREEN = "\x1b[0;32m"; + const YELLOW = "\x1b[1;33m"; + const RED = "\x1b[0;31m"; + const BOLD = "\x1b[1m"; + const RESET = "\x1b[0m"; + const icons: Record = { + partitioning: "◆", installing: "◆◆", "post-install": "◆◆◆", + complete: "✔", error: "✘", + }; + const icon = icons[stageName] ?? "·"; + const color = stageName === "complete" ? GREEN : stageName === "error" ? RED : YELLOW; + console.log(` ${color}${icon}${RESET} ${mac} ${BOLD}${stageName}${RESET}${detailStr ? ` -- ${detailStr}` : ""}`); state.update((s) => { const queueEntry = s.install_queue[mac]; @@ -100,7 +111,8 @@ export function registerApiRoutes( }; s.installed[mac] = installedInfo; - logger.info(`INSTALL COMPLETE: ${mac} -> ${installedInfo.hostname} (${ip})`); + const admin = state.load().installed[mac]?.role ? "michal" : "root"; + console.log(`\n \x1b[0;32m\x1b[1m ssh ${admin}@${ip}\x1b[0m\n`); } } });