update add_gpu_vm.sh

This commit is contained in:
MacRimi
2026-04-06 22:04:38 +02:00
parent 2174c04e4f
commit 2f5b8ce4ed
5 changed files with 29 additions and 16 deletions

View File

@@ -1306,13 +1306,22 @@ check_switch_mode() {
msg+="$(translate 'Choose conflict policy for the source VM:')" msg+="$(translate 'Choose conflict policy for the source VM:')"
local vm_action_choice local vm_action_choice
vm_action_choice=$(dialog --backtitle "ProxMenux" --colors \ if [[ "$WIZARD_CALL" == "true" ]]; then
--title "$(translate 'GPU Already Assigned to Another VM')" \ vm_action_choice=$(whiptail --backtitle "ProxMenux" \
--default-item "1" \ --title "$(translate 'GPU Already Assigned to Another VM')" \
--menu "$msg" 24 98 8 \ --menu "$msg" 24 98 8 \
"1" "$(translate 'Keep GPU in source VM config (disable Start on boot if enabled)')" \ "1" "$(translate 'Keep GPU in source VM config (disable Start on boot if enabled)')" \
"2" "$(translate 'Remove GPU from source VM config (keep Start on boot)')" \ "2" "$(translate 'Remove GPU from source VM config (keep Start on boot)')" \
2>&1 >/dev/tty) || exit 0 3>&1 1>&2 2>&3) || exit 0
else
vm_action_choice=$(dialog --backtitle "ProxMenux" --colors \
--title "$(translate 'GPU Already Assigned to Another VM')" \
--default-item "1" \
--menu "$msg" 24 98 8 \
"1" "$(translate 'Keep GPU in source VM config (disable Start on boot if enabled)')" \
"2" "$(translate 'Remove GPU from source VM config (keep Start on boot)')" \
2>&1 >/dev/tty) || exit 0
fi
case "$vm_action_choice" in case "$vm_action_choice" in
1) SWITCH_VM_ACTION="keep_gpu_disable_onboot" ;; 1) SWITCH_VM_ACTION="keep_gpu_disable_onboot" ;;
@@ -1390,11 +1399,15 @@ confirm_summary() {
local run_title local run_title
run_title=$(_get_vm_run_title) run_title=$(_get_vm_run_title)
dialog --backtitle "ProxMenux" --colors \ if [[ "$WIZARD_CALL" == "true" ]]; then
--title "${run_title}" \ whiptail --backtitle "ProxMenux" --title "${run_title}" --yesno "$msg" 28 78
--yesno "$msg" 28 78 [[ $? -ne 0 ]] && exit 0
else
[[ $? -ne 0 ]] && exit 0 dialog --backtitle "ProxMenux" --colors \
--title "${run_title}" \
--yesno "$msg" 28 78
[[ $? -ne 0 ]] && exit 0
fi
} }

View File

@@ -293,7 +293,7 @@ select_controller_nvme() {
fi fi
dialog --backtitle "ProxMenux" \ dialog --backtitle "ProxMenux" \
--title "$(translate "Controller + NVMe")" \ --title "$(translate "Controller + NVMe")" \
--msgbox "$msg" 22 100 --msgbox "$msg" 18 84
return 1 return 1
fi fi

View File

@@ -360,7 +360,7 @@ function select_controller_nvme() {
if [[ $blocked_count -gt 0 ]]; then if [[ $blocked_count -gt 0 ]]; then
msg+="$(translate "Hidden for safety"):\n${blocked_report}" msg+="$(translate "Hidden for safety"):\n${blocked_report}"
fi fi
whiptail --title "Controller + NVMe" --msgbox "$msg" 22 100 whiptail --title "Controller + NVMe" --msgbox "$msg" 18 84
return 1 return 1
fi fi

View File

@@ -711,7 +711,7 @@ function select_controller_nvme() {
msg+="$(translate "Hidden for safety"):\n${blocked_report}" msg+="$(translate "Hidden for safety"):\n${blocked_report}"
fi fi
fi fi
whiptail --title "Controller + NVMe" --msgbox "$msg" 22 100 whiptail --title "Controller + NVMe" --msgbox "$msg" 18 84
return 1 return 1
fi fi

View File

@@ -725,7 +725,7 @@ function select_controller_nvme() {
msg+="$(translate "Hidden for safety"):\n${blocked_report}" msg+="$(translate "Hidden for safety"):\n${blocked_report}"
fi fi
fi fi
whiptail --title "Controller + NVMe" --msgbox "$msg" 22 100 whiptail --title "Controller + NVMe" --msgbox "$msg" 18 84
return 1 return 1
fi fi