update gui
This commit is contained in:
+35
-10
@@ -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]}"
|
||||
|
||||
Reference in New Issue
Block a user