From d6b4349b9c7ca5b159e878a91c7ee6823fd2f11d Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:23:33 +0100 Subject: [PATCH] Add preflight category styling and mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new 'preflight' category and wire it through the UI and service logic. Updates: - public/static/css/error-analysis.css: add .category-badge styles (preflight, proxmox, service, database, shell, build) to provide consistent color badges. - public/static/js/error-analysis.js: add 'preflight' color to catColors so the UI can render the new category. - service.go: register 'preflight' as a known category and reclassify exit codes 103–108 from various categories to 'preflight' (these are validation/initial checks). This groups validation-related errors under a single category for clearer display and handling in the frontend. --- public/static/css/error-analysis.css | 30 ++++++++++++++++++++++++++++ public/static/js/error-analysis.js | 3 ++- service.go | 14 ++++++------- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/public/static/css/error-analysis.css b/public/static/css/error-analysis.css index a6785b2..b170fbd 100644 --- a/public/static/css/error-analysis.css +++ b/public/static/css/error-analysis.css @@ -475,6 +475,36 @@ tr:hover td { color: var(--text-muted); } +.category-badge.preflight { + background: rgba(20, 184, 166, 0.15); + color: #14b8a6; +} + +.category-badge.proxmox { + background: rgba(245, 158, 11, 0.15); + color: #f59e0b; +} + +.category-badge.service { + background: rgba(6, 182, 212, 0.15); + color: #06b6d4; +} + +.category-badge.database { + background: rgba(139, 92, 246, 0.15); + color: #8b5cf6; +} + +.category-badge.shell { + background: rgba(251, 146, 60, 0.15); + color: #fb923c; +} + +.category-badge.build { + background: rgba(217, 70, 239, 0.15); + color: #d946ef; +} + .charts-grid { display: grid; grid-template-columns: 1fr 1fr; diff --git a/public/static/js/error-analysis.js b/public/static/js/error-analysis.js index adb5395..4465c2f 100644 --- a/public/static/js/error-analysis.js +++ b/public/static/js/error-analysis.js @@ -9,7 +9,8 @@ const catColors = { 'storage': '#ec4899', 'resource': '#f97316', 'dependency': '#22d3ee', 'signal': '#eab308', 'config': '#84cc16', 'unknown': '#64748b', 'uncategorized': '#94a3b8', 'service': '#06b6d4', 'database': '#8b5cf6', - 'proxmox': '#f59e0b', 'shell': '#fb923c', 'build': '#d946ef' + 'proxmox': '#f59e0b', 'shell': '#fb923c', 'build': '#d946ef', + 'preflight': '#14b8a6' }; function escapeHtml(str) { diff --git a/service.go b/service.go index 4789c47..7e2e2cb 100644 --- a/service.go +++ b/service.go @@ -1009,7 +1009,7 @@ var ( "timeout": true, "config": true, "resource": true, "unknown": true, "": true, "user_aborted": true, "apt": true, "command_not_found": true, "service": true, "database": true, "signal": true, "proxmox": true, - "shell": true, "build": true, + "shell": true, "build": true, "preflight": true, } // exitCodeInfo consolidates description and category for all known exit codes. @@ -1081,12 +1081,12 @@ var ( 102: {"APT: Lock held by another process", "apt"}, // --- Script Validation & Setup (103-123) --- - 103: {"Validation: Shell is not Bash", "config"}, - 104: {"Validation: Not running as root", "permission"}, - 105: {"Validation: PVE version not supported", "config"}, - 106: {"Validation: Architecture not supported (ARM/PiMox)", "config"}, - 107: {"Validation: Kernel key parameters unreadable", "config"}, - 108: {"Validation: Kernel key limits exceeded", "config"}, + 103: {"Validation: Shell is not Bash", "preflight"}, + 104: {"Validation: Not running as root", "preflight"}, + 105: {"Validation: PVE version not supported", "preflight"}, + 106: {"Validation: Architecture not supported (ARM/PiMox)", "preflight"}, + 107: {"Validation: Kernel key parameters unreadable", "preflight"}, + 108: {"Validation: Kernel key limits exceeded", "preflight"}, 109: {"Proxmox: No available container ID", "proxmox"}, 110: {"Proxmox: Failed to apply default.vars", "proxmox"}, 111: {"Proxmox: App defaults file not available", "proxmox"},