From c48e89af6cdbfa9380eb1bbf613950cc9beeb110 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 28 Jul 2026 21:15:50 -0500 Subject: [PATCH] update gui --- defaults.inc | 2 +- proxmenu-scripts.sh | 45 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/defaults.inc b/defaults.inc index 3316433..b5484af 100755 --- a/defaults.inc +++ b/defaults.inc @@ -3,7 +3,7 @@ action="${1:-}" FOLDER='/opt/idssys/ta-proxmenu' -VERS='2026.7.28-6' +VERS='2026.7.28-7' noupdate=' ' diff --git a/proxmenu-scripts.sh b/proxmenu-scripts.sh index 338307a..9423bc0 100755 --- a/proxmenu-scripts.sh +++ b/proxmenu-scripts.sh @@ -1653,7 +1653,13 @@ FORCE_UPDATE_CHECK() { MENU_HEADER() { - local version_display + local header_title='TA-ProxMenu - Proxmox Setup Scripts' + local header_width=75 + local status_color='' + local status_display='' + local version_color="${idsCL[White]}" + local right_width + local spacer_width # Reuse a settled update result instead of running Git checks on every # arrow-key redraw. Continue refreshing only while the worker is pending. @@ -1662,28 +1668,47 @@ MENU_HEADER() { fi case "$UPDATE_STATUS" in behind) - version_display="${idsCL[LightYellow]}${VERS} ** UPDATE AVAILABLE **${idsCL[Default]}" + status_display='** UPDATE AVAILABLE **' + status_color="${idsCL[LightYellow]}" + version_color="${idsCL[LightYellow]}" ;; ahead) - version_display="${idsCL[LightYellow]}${VERS} ** LOCAL COMMITS **${idsCL[Default]}" + status_display='** LOCAL COMMITS **' + status_color="${idsCL[LightYellow]}" + version_color="${idsCL[LightYellow]}" ;; diverged) - version_display="${idsCL[LightRed]}${VERS} ** BRANCH DIVERGED **${idsCL[Default]}" + status_display='** BRANCH DIVERGED **' + status_color="${idsCL[LightRed]}" + version_color="${idsCL[LightRed]}" ;; dirty) - version_display="${idsCL[LightYellow]}${VERS} ** LOCAL CHANGES **${idsCL[Default]}" + status_display='** LOCAL CHANGES **' + status_color="${idsCL[LightYellow]}" + version_color="${idsCL[LightYellow]}" ;; checking) - version_display="${idsCL[LightCyan]}${VERS} (checking for updates)${idsCL[Default]}" - ;; - *) - version_display="${idsCL[White]}${VERS}${idsCL[Default]}" + status_display='(checking for updates)' + status_color="${idsCL[LightCyan]}" + version_color="${idsCL[LightCyan]}" ;; esac + right_width="${#VERS}" + if [[ -n "$status_display" ]]; then + right_width=$((right_width + ${#status_display} + 2)) + fi + spacer_width=$((header_width - 1 - ${#header_title} - right_width)) + ((spacer_width < 2)) && spacer_width=2 + clear echo - echo -e " ${idsCL[Green]}TA-ProxMenu - Proxmox Setup Scripts${idsCL[Default]} ${version_display}" + printf ' %b%s%b%*s' \ + "${idsCL[Green]}" "$header_title" "${idsCL[Default]}" "$spacer_width" '' + if [[ -n "$status_display" ]]; then + printf '%b%s%b ' "$status_color" "$status_display" "${idsCL[Default]}" + fi + printf '%b%s%b\n' "$version_color" "$VERS" "${idsCL[Default]}" echo -e "${idsCL[Green]}---------------------------------------------------------------------------${idsCL[Default]}" echo -e " Hostname: ${idsCL[Cyan]}$(hostname -s)${idsCL[Default]}" echo -e " IP Address: ${idsCL[Cyan]}${RNIP:-Unavailable}${idsCL[Default]}"