Update menu VM

This commit is contained in:
MacRimi 2025-05-07 21:28:01 +02:00
parent f61f356d87
commit 1e98059760
3 changed files with 62 additions and 31 deletions

View File

@ -78,7 +78,7 @@ function start_vm_configuration() {
while true; do while true; do
OS_TYPE=$(dialog --backtitle "ProxMenux" \ OS_TYPE=$(dialog --backtitle "ProxMenux" \
--title "$(translate "Select System Type")" \ --title "$(translate "Select System Type")" \
--menu "$(translate "Choose the type of virtual system to install:")" 18 64 8 \ --menu "$(translate "Choose the type of virtual system to install:")" 18 70 8 \
1 "$(translate "Create") VM System NAS" \ 1 "$(translate "Create") VM System NAS" \
2 "$(translate "Create") VM System Windows" \ 2 "$(translate "Create") VM System Windows" \
3 "$(translate "Create") VM System Linux" \ 3 "$(translate "Create") VM System Linux" \

View File

@ -20,8 +20,8 @@ mkdir -p "$ISO_DIR"
function select_nas_iso() { function select_nas_iso() {
local NAS_OPTIONS=( local NAS_OPTIONS=(
"1" "Synology DSM VM" "1" "Synology DSM VM (Loader Linux-based)"
"2" "TrueNAS SCALE VM (Fangtooth)" "2" "TrueNAS SCALE VM (Dragonfish)"
"3" "TrueNAS CORE VM (FreeBSD based)" "3" "TrueNAS CORE VM (FreeBSD based)"
"4" "OpenMediaVault VM (Debian based)" "4" "OpenMediaVault VM (Debian based)"
"5" "Rockstor VM (openSUSE based)" "5" "Rockstor VM (openSUSE based)"
@ -32,7 +32,7 @@ function select_nas_iso() {
local NAS_TYPE local NAS_TYPE
NAS_TYPE=$(dialog --backtitle "ProxMenux" \ NAS_TYPE=$(dialog --backtitle "ProxMenux" \
--title "$(translate "NAS Systems")" \ --title "$(translate "NAS Systems")" \
--menu "$(translate "Select the NAS system to install:")" 18 64 10 \ --menu "\n$(translate "Select the NAS system to install:")" 18 70 10 \
"${NAS_OPTIONS[@]}" 3>&1 1>&2 2>&3) "${NAS_OPTIONS[@]}" 3>&1 1>&2 2>&3)
# Si se pulsa ESC o Cancelar # Si se pulsa ESC o Cancelar

View File

@ -17,35 +17,66 @@ initialize_cache
mkdir -p "$ISO_DIR" mkdir -p "$ISO_DIR"
function select_windows_iso() { function select_windows_iso() {
local CHOICE local EXIT_FLAG="no"
CHOICE=$(dialog --backtitle "ProxMenux" --title "$(translate "Windows ISO")" \ local header
--menu "$(translate "Select how to provide the Windows ISO:")" 15 60 5 \ if [[ "$LANGUAGE" == "es" ]]; then
1 "$(translate "Use existing ISO from storage")" \ header=$(printf "%-41s│ %s" " Descripción" "Fuente")
2 "$(translate "Download ISO using UUP Dump")" \ else
3 "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3) header=$(printf "%-42s│ %s" " $(translate "Description")" "$(translate "Source")")
fi
[[ $? -ne 0 ]] && return 1 # ESC o cancelar while [[ "$EXIT_FLAG" != "yes" ]]; do
if [[ "$LANGUAGE" == "es" ]]; then
CHOICE=$(dialog --clear \
--backtitle "ProxMenux" \
--title "Opciones de instalación de Windows" \
--menu "\nSeleccione el tipo de instalación de Windows:\n\n$header" \
18 70 10 \
1 "$(printf '%-34s│ %s' 'Instalar con ISO UUP Dump' 'UUP Dump ISO creator')" \
2 "$(printf '%-34s│ %s' 'Instalar con ISO personal' 'Almacenamiento local')" \
3 "Volver al menú principal" \
3>&1 1>&2 2>&3)
else
local desc1 desc2 back
desc1="$(translate "Install with ISO from UUP Dump")"
desc2="$(translate "Install with personal ISO")"
back="$(translate "Return to main menu")"
CHOICE=$(dialog --clear \
--backtitle "ProxMenux" \
--title "$(translate "Windows Installation Options")" \
--menu "\n$(translate "Select the type of Windows installation:")\n\n$header" \
16 70 10 \
1 "$(printf '%-35s│ %s' "$desc1" "UUP Dump creator")" \
2 "$(printf '%-35s│ %s' "$desc2" "Local Storage")" \
3 "$back" \
3>&1 1>&2 2>&3)
fi
if [[ $? -ne 0 || "$CHOICE" == "3" ]]; then
unset ISO_NAME ISO_TYPE ISO_URL ISO_FILE ISO_PATH HN
return 1
fi
case "$CHOICE" in case "$CHOICE" in
1) 1)
select_existing_iso || return 1
;;
2)
if source <(curl -fsSL "$UUP_REPO/uupdump_creator.sh"); then if source <(curl -fsSL "$UUP_REPO/uupdump_creator.sh"); then
run_uupdump_creator || return 1 run_uupdump_creator || return 1
detect_latest_iso_created || return 1 detect_latest_iso_created || return 1
EXIT_FLAG="yes"
else else
msg_error "$(translate "UUP Dump script not found.")" msg_error "$(translate "UUP Dump script not found.")"
return 1 return 1
fi fi
;; ;;
3) 2)
return 1 select_existing_iso || return 1
EXIT_FLAG="yes"
;; ;;
esac esac
return 0 done
} }
function select_existing_iso() { function select_existing_iso() {
ISO_LIST=() ISO_LIST=()
while read -r line; do while read -r line; do