mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-26 06:11:15 +00:00
Update main menu PVE 9
This commit is contained in:
@@ -16,27 +16,85 @@ BASE_DIR="/usr/local/share/proxmenux"
|
||||
UTILS_FILE="$BASE_DIR/utils.sh"
|
||||
VENV_PATH="/opt/googletrans-env"
|
||||
|
||||
|
||||
check_pve9_translation_compatibility() {
|
||||
local pve_version
|
||||
|
||||
if command -v pveversion &>/dev/null; then
|
||||
pve_version=$(pveversion 2>/dev/null | grep -oP 'pve-manager/\K[0-9]+' | head -1)
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -n "$pve_version" ]] && [[ "$pve_version" -ge 9 ]] && [[ -d "$VENV_PATH" ]]; then
|
||||
|
||||
local has_googletrans=false
|
||||
local has_cache=false
|
||||
|
||||
if [[ -f "$VENV_PATH/bin/pip" ]]; then
|
||||
if "$VENV_PATH/bin/pip" list 2>/dev/null | grep -q "googletrans"; then
|
||||
has_googletrans=true
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "$BASE_DIR/cache.json" ]]; then
|
||||
has_cache=true
|
||||
fi
|
||||
|
||||
if [[ "$has_googletrans" = true ]] || [[ "$has_cache" = true ]]; then
|
||||
|
||||
dialog --clear \
|
||||
--backtitle "ProxMenux - Compatibility Required" \
|
||||
--title "Translation Environment Incompatible with PVE $pve_version" \
|
||||
--msgbox "NOTICE: You are running Proxmox VE $pve_version with translation components installed.\n\nTranslations are NOT supported in PVE 9+. This causes:\n• Menu loading errors\n• Translation failures\n• System instability\n\nREQUIRED ACTION:\nProxMenux will now automatically reinstall the Normal Version.\n\nThis process will:\n• Remove incompatible translation components\n• Install PVE 9+ compatible version\n• Preserve all your settings and preferences\n\nPress OK to continue with automatic reinstallation..." 20 75
|
||||
|
||||
bash <(curl -sSL "$REPO_URL/install_proxmenux.sh")
|
||||
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
check_pve9_translation_compatibility
|
||||
|
||||
# ==========================================================
|
||||
|
||||
if [[ -f "$UTILS_FILE" ]]; then
|
||||
source "$UTILS_FILE"
|
||||
fi
|
||||
|
||||
load_language
|
||||
initialize_cache
|
||||
# ==========================================================
|
||||
|
||||
if ! command -v dialog &>/dev/null; then
|
||||
apt update -qq >/dev/null 2>&1
|
||||
apt install -y dialog >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ "$PROXMENUX_PVE9_WARNING_SHOWN" = "1" ]]; then
|
||||
|
||||
if ! load_language 2>/dev/null; then
|
||||
LANGUAGE="en"
|
||||
fi
|
||||
|
||||
else
|
||||
load_language
|
||||
initialize_cache
|
||||
fi
|
||||
|
||||
# ==========================================================
|
||||
|
||||
show_menu() {
|
||||
local TEMP_FILE
|
||||
TEMP_FILE=$(mktemp)
|
||||
|
||||
while true; do
|
||||
|
||||
local menu_title="Main ProxMenux"
|
||||
if [[ -n "$PROXMENUX_PVE9_WARNING_SHOWN" ]]; then
|
||||
menu_title="Main ProxMenux"
|
||||
fi
|
||||
|
||||
dialog --clear \
|
||||
--backtitle "ProxMenux" \
|
||||
--title "$(translate "Main ProxMenux")" \
|
||||
--title "$(translate "$menu_title")" \
|
||||
--menu "$(translate "Select an option:")" 20 70 10 \
|
||||
1 "$(translate "Settings post-install Proxmox")" \
|
||||
2 "$(translate "Help and Info Commands")" \
|
||||
@@ -52,7 +110,6 @@ show_menu() {
|
||||
local EXIT_STATUS=$?
|
||||
|
||||
if [[ $EXIT_STATUS -ne 0 ]]; then
|
||||
# ESC pressed or Cancel
|
||||
clear
|
||||
msg_ok "$(translate "Thank you for using ProxMenux. Goodbye!")"
|
||||
rm -f "$TEMP_FILE"
|
||||
@@ -63,7 +120,7 @@ show_menu() {
|
||||
|
||||
case $OPTION in
|
||||
1) exec bash <(curl -s "$REPO_URL/scripts/menus/menu_post_install.sh") ;;
|
||||
2) bash <(curl -s "$REPO_URL/scripts/help_info_menu.sh") ;;
|
||||
2) exec bash <(curl -s "$REPO_URL/scripts/help_info_menu.sh") ;;
|
||||
3) exec bash <(curl -s "$REPO_URL/scripts/menus/hw_grafics_menu.sh") ;;
|
||||
4) exec bash <(curl -s "$REPO_URL/scripts/menus/create_vm_menu.sh") ;;
|
||||
5) exec bash <(curl -s "$REPO_URL/scripts/menus/storage_menu.sh") ;;
|
||||
@@ -77,6 +134,4 @@ show_menu() {
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
show_menu
|
||||
show_menu
|
Reference in New Issue
Block a user