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
OS_TYPE=$(dialog --backtitle "ProxMenux" \
--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" \
2 "$(translate "Create") VM System Windows" \
3 "$(translate "Create") VM System Linux" \

View File

@ -20,8 +20,8 @@ mkdir -p "$ISO_DIR"
function select_nas_iso() {
local NAS_OPTIONS=(
"1" "Synology DSM VM"
"2" "TrueNAS SCALE VM (Fangtooth)"
"1" "Synology DSM VM (Loader Linux-based)"
"2" "TrueNAS SCALE VM (Dragonfish)"
"3" "TrueNAS CORE VM (FreeBSD based)"
"4" "OpenMediaVault VM (Debian based)"
"5" "Rockstor VM (openSUSE based)"
@ -32,7 +32,7 @@ function select_nas_iso() {
local NAS_TYPE
NAS_TYPE=$(dialog --backtitle "ProxMenux" \
--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)
# Si se pulsa ESC o Cancelar

View File

@ -17,35 +17,66 @@ initialize_cache
mkdir -p "$ISO_DIR"
function select_windows_iso() {
local CHOICE
CHOICE=$(dialog --backtitle "ProxMenux" --title "$(translate "Windows ISO")" \
--menu "$(translate "Select how to provide the Windows ISO:")" 15 60 5 \
1 "$(translate "Use existing ISO from storage")" \
2 "$(translate "Download ISO using UUP Dump")" \
3 "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3)
local EXIT_FLAG="no"
local header
if [[ "$LANGUAGE" == "es" ]]; then
header=$(printf "%-41s│ %s" " Descripción" "Fuente")
else
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
1)
select_existing_iso || return 1
;;
2)
if source <(curl -fsSL "$UUP_REPO/uupdump_creator.sh"); then
run_uupdump_creator || return 1
detect_latest_iso_created || return 1
EXIT_FLAG="yes"
else
msg_error "$(translate "UUP Dump script not found.")"
return 1
fi
;;
3)
return 1
2)
select_existing_iso || return 1
EXIT_FLAG="yes"
;;
esac
return 0
done
}
function select_existing_iso() {
ISO_LIST=()
while read -r line; do