From 305b2823b76ba72d919f3f57970e10393043b575 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Wed, 7 May 2025 21:42:50 +0200 Subject: [PATCH] Update menu VM --- scripts/vm/create_vm.sh | 2 +- scripts/vm/disk_selector.sh | 16 ++++++++-------- scripts/vm/select_linux_iso.sh | 6 +++--- scripts/vm/select_nas_iso.sh | 4 ++-- scripts/vm/uupdump_creator.sh | 2 +- scripts/vm/vm_configurator.sh | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/vm/create_vm.sh b/scripts/vm/create_vm.sh index 735ee21..dd5da63 100644 --- a/scripts/vm/create_vm.sh +++ b/scripts/vm/create_vm.sh @@ -78,7 +78,7 @@ function start_vm_configuration() { while true; do OS_TYPE=$(dialog --backtitle "ProxMenux" \ --title "$(translate "Select System Type")" \ - --menu "$(translate "Choose the type of virtual system to install:")" 18 70 8 \ + --menu "\n$(translate "Choose the type of virtual system to install:")" 18 70 8 \ 1 "$(translate "Create") VM System NAS" \ 2 "$(translate "Create") VM System Windows" \ 3 "$(translate "Create") VM System Linux" \ diff --git a/scripts/vm/disk_selector.sh b/scripts/vm/disk_selector.sh index 82cb0fb..0bed383 100644 --- a/scripts/vm/disk_selector.sh +++ b/scripts/vm/disk_selector.sh @@ -41,13 +41,13 @@ function select_virtual_disk() { VIRTUAL_DISKS=() - # Loop to add multiple disks + local add_more_disks=true while $add_more_disks; do msg_info "Detecting available storage volumes..." - # Get list of available storage + STORAGE_MENU=() while read -r line; do TAG=$(echo $line | awk '{print $1}') @@ -57,7 +57,7 @@ function select_virtual_disk() { STORAGE_MENU+=("$TAG" "$ITEM" "OFF") done < <(pvesm status -content images | awk 'NR>1') - # Check that storage is available + VALID=$(pvesm status -content images | awk 'NR>1') if [ -z "$VALID" ]; then msg_error "Unable to detect a valid storage location." @@ -66,7 +66,7 @@ function select_virtual_disk() { fi - # Select storage + if [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then STORAGE=${STORAGE_MENU[0]} msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location." @@ -90,7 +90,7 @@ function select_virtual_disk() { fi - # Request disk size + DISK_SIZE=$(whiptail --backtitle "ProxMenuX" --inputbox "$(translate "System Disk Size (GB)")" 8 58 32 --title "VIRTUAL DISK" --cancel-button Cancel 3>&1 1>&2 2>&3) if [ $? -ne 0 ]; then @@ -109,18 +109,18 @@ function select_virtual_disk() { DISK_SIZE="32" fi - # Store the configuration in the disk list + VIRTUAL_DISKS+=("${STORAGE}:${DISK_SIZE}") - # Ask if you want to create another disk + if ! whiptail --backtitle "ProxMenuX" --title "$(translate "Add Another Disk")" \ --yesno "$(translate "Do you want to add another virtual disk?")" 8 58; then add_more_disks=false fi done - # Show summary of the created disks + if [ ${#VIRTUAL_DISKS[@]} -gt 0 ]; then msg_ok "Virtual Disks Created:" diff --git a/scripts/vm/select_linux_iso.sh b/scripts/vm/select_linux_iso.sh index a29f663..c996807 100644 --- a/scripts/vm/select_linux_iso.sh +++ b/scripts/vm/select_linux_iso.sh @@ -33,7 +33,7 @@ function select_linux_iso() { while [[ "$EXIT_FLAG" != "yes" ]]; do if [[ "$LANGUAGE" == "es" ]]; then - # Menú en español formateado manualmente + CHOICE=$(dialog --clear \ --backtitle "ProxMenux" \ --title "Opciones de instalación de Linux" \ @@ -45,7 +45,7 @@ function select_linux_iso() { 4 "Volver al menú principal" \ 3>&1 1>&2 2>&3) else - # Menú multilingüe con traducción + local desc1 desc2 desc3 back desc1="$(translate "Install with traditional method")" desc2="$(translate "Install with Cloud-Init script")" @@ -240,7 +240,7 @@ function select_linux_other_scripts() { 2) bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/docker-vm.sh)" - # Mostrar credenciales + whiptail --title "Docker VM Info" \ --msgbox "$(translate "Default Login Credentials:\n\nUsername: root\nPassword: docker")" 12 50 ;; diff --git a/scripts/vm/select_nas_iso.sh b/scripts/vm/select_nas_iso.sh index 6098cc9..b0f67d5 100644 --- a/scripts/vm/select_nas_iso.sh +++ b/scripts/vm/select_nas_iso.sh @@ -4,7 +4,7 @@ # ProxMenux - NAS ISO Selector (Dialog Edition) # ============================================================== -# Configuración Base + BASE_DIR="/usr/local/share/proxmenux" UTILS_FILE="$BASE_DIR/utils.sh" VENV_PATH="/opt/googletrans-env" @@ -35,7 +35,7 @@ function select_nas_iso() { --menu "\n$(translate "Select the NAS system to install:")" 18 70 10 \ "${NAS_OPTIONS[@]}" 3>&1 1>&2 2>&3) - # Si se pulsa ESC o Cancelar + [[ $? -ne 0 ]] && return 1 case "$NAS_TYPE" in diff --git a/scripts/vm/uupdump_creator.sh b/scripts/vm/uupdump_creator.sh index c52578f..ad3a113 100644 --- a/scripts/vm/uupdump_creator.sh +++ b/scripts/vm/uupdump_creator.sh @@ -84,7 +84,7 @@ if [[ ! -f "$CONVERTER/convert.sh" ]]; then cd "$TMP_DIR" || exit 1 fi -# Crear script de descarga uup_download_linux.sh + cat > uup_download_linux.sh </dev/null || echo "100") [[ -z "$MAC" ]] && MAC=$(generate_mac)