mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-29 18:16:43 +00:00
fix(tui): correct network, storage, upgrade, and GPU guidance
This commit is contained in:
@@ -1459,9 +1459,8 @@ check_switch_mode() {
|
||||
msg="\n$(translate 'The selected GPU is already assigned to another VM that is currently running:')\n\n"
|
||||
msg+=" VM ${vm_src_id} (${vm_src_name:-VM-${vm_src_id}})\n\n"
|
||||
msg+="$(translate 'The same GPU cannot be used by two VMs at the same time.')\n\n"
|
||||
msg+="$(translate 'Next step: stop that VM first, then run')\n"
|
||||
msg+=" Hardware Graphics → Add GPU to VM\n"
|
||||
msg+="$(translate 'to move the GPU safely.')"
|
||||
msg+="$(translate 'Stop that VM, then choose:')\n"
|
||||
msg+=" $(translate 'Hardware: GPUs and Coral-TPU') → $(translate 'Add GPU to VM (Intel | AMD | NVIDIA)')\n"
|
||||
|
||||
_pmx_msgbox "$(translate 'GPU Busy in Running VM')" "$msg" 16 78
|
||||
exit 0
|
||||
|
||||
@@ -646,7 +646,13 @@ mount_existing_disk() {
|
||||
mkdir -p "$mount_path"
|
||||
msg_ok "$(translate "Mount point created")"
|
||||
|
||||
msg_info "$(translate "Mounting existing") $existing_fs $(translate "filesystem...")"
|
||||
local mount_message
|
||||
mount_message="$(translate "Mounting existing filesystem ({filesystem})...")"
|
||||
if [[ "$mount_message" != *'{filesystem}'* ]]; then
|
||||
mount_message="Mounting existing filesystem ({filesystem})..."
|
||||
fi
|
||||
mount_message="${mount_message//\{filesystem\}/$existing_fs}"
|
||||
msg_info "$mount_message"
|
||||
if ! mount "$disk" "$mount_path" 2>/dev/null; then
|
||||
msg_error "$(translate "Failed to mount disk")"
|
||||
return 1
|
||||
|
||||
@@ -471,7 +471,7 @@ test_iscsi_connectivity() {
|
||||
if nc -z -w 2 "$portal_host" "$portal_port" 2>/dev/null; then
|
||||
echo -e " | iSCSI port $portal_port: ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo -e " | iSCSI port $portal_port: ${RD}$(translate "Closed")${CL}"
|
||||
echo -e " | iSCSI port $portal_port: ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
else
|
||||
echo -e "${RD}$(translate "Unreachable")${CL}"
|
||||
|
||||
@@ -678,7 +678,7 @@ test_nfs_connectivity() {
|
||||
if pct exec "$CTID" -- nc -z -w 2 "$server" 2049 2>/dev/null; then
|
||||
echo -e "\033[1;92m$(translate "Open")\033[0m"
|
||||
else
|
||||
echo -e "\033[1;91m$(translate "Closed")\033[0m"
|
||||
echo -e "\033[1;91m$(translate "Probe failed")\033[0m"
|
||||
fi
|
||||
|
||||
# Try to list exports
|
||||
|
||||
@@ -839,7 +839,7 @@ test_nfs_connectivity() {
|
||||
if nc -z -w 2 "$server" 2049 2>/dev/null; then
|
||||
echo -e " | NFS port 2049: ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo -e " | NFS port 2049: ${RD}$(translate "Closed")${CL}"
|
||||
echo -e " | NFS port 2049: ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
|
||||
if showmount -e "$server" >/dev/null 2>&1; then
|
||||
@@ -882,7 +882,7 @@ test_nfs_connectivity() {
|
||||
if nc -z -w 2 "$server" 2049 2>/dev/null; then
|
||||
echo -e " | NFS port 2049: ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo -e " | NFS port 2049: ${RD}$(translate "Closed")${CL}"
|
||||
echo -e " | NFS port 2049: ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
else
|
||||
echo -e "${RD}$(translate "Unreachable")${CL}"
|
||||
|
||||
@@ -1044,7 +1044,7 @@ test_samba_connectivity() {
|
||||
elif pct exec "$CTID" -- nc -z -w 2 "$server" 139 2>/dev/null; then
|
||||
echo " $(translate "NetBIOS port 139:"): ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo " $(translate "SMB ports:"): ${RD}$(translate "Closed")${CL}"
|
||||
echo " $(translate "SMB ports:"): ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -918,7 +918,7 @@ test_samba_connectivity() {
|
||||
elif nc -z -w 2 "$server" 139 2>/dev/null; then
|
||||
echo -e " | NetBIOS 139: ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo -e " | SMB ports: ${RD}$(translate "Closed")${CL}"
|
||||
echo -e " | SMB ports: ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
|
||||
echo -n " $(translate "Guest access test:"): "
|
||||
@@ -964,7 +964,7 @@ test_samba_connectivity() {
|
||||
elif nc -z -w 2 "$server" 139 2>/dev/null; then
|
||||
echo -e " | NetBIOS 139: ${GN}$(translate "Open")${CL}"
|
||||
else
|
||||
echo -e " | SMB ports: ${RD}$(translate "Closed")${CL}"
|
||||
echo -e " | SMB ports: ${RD}$(translate "Probe failed")${CL}"
|
||||
fi
|
||||
else
|
||||
echo -e "${RD}$(translate "Unreachable")${CL}"
|
||||
|
||||
@@ -457,7 +457,7 @@ for DISK in $SELECTED; do
|
||||
if lsblk "$DISK" | grep -q "raid" || grep -q "${DISK##*/}" /proc/mdstat; then
|
||||
dialog --backtitle "$BACKTITLE" \
|
||||
--title "$(translate "RAID Detected")" \
|
||||
--msgbox "\n$(translate "The disk") $DISK_INFO $(translate "appears to be part of a") RAID. $(translate "For security reasons, the system cannot format it.")\\n\\n$(translate "If you are sure you want to use it, please remove the") RAID metadata $(translate "or format it manually using external tools.")\\n\\n$(translate "After that, run this script again to add it.")" $UI_RESULT_H $UI_RESULT_W
|
||||
--msgbox "\n$(translate "The disk") $DISK_INFO $(translate "appears to be part of a") RAID. $(translate "For security reasons, the system cannot format it.")\\n\\n$(translate "If you are sure you want to use it, remove the RAID metadata or format it manually using external tools.")\\n\\n$(translate "After that, run this script again to add it.")" $UI_RESULT_H $UI_RESULT_W
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
@@ -187,7 +187,11 @@ run_pve8to9_check2() {
|
||||
echo -e
|
||||
done
|
||||
echo -e
|
||||
msg_info2 "$(translate "Once finished, re-run the script 'PVE 8 to 9 check' to verify that all issues.")"
|
||||
local check_help
|
||||
check_help="$(translate "Once finished, repeat the check ({check}) to review any remaining issues.")"
|
||||
[[ "$check_help" == *'{check}'* ]] || check_help="Once finished, repeat the check ({check}) to review any remaining issues."
|
||||
check_help="${check_help//\{check\}/$(translate "Run PVE 8 to 9 check")}"
|
||||
msg_info2 "$check_help"
|
||||
echo -e
|
||||
msg_success "$(translate "Press Enter to exit the script after reading instructions...")"
|
||||
read -r
|
||||
|
||||
@@ -135,7 +135,7 @@ ask_run_mode() {
|
||||
--menu "$text" 20 70 8 \
|
||||
1 "$(translate "Automatic/Unattended")" \
|
||||
2 "$(translate "Interactive (guided, prompts visible)")" \
|
||||
3 "$(translate "Run PVE 8 to 9") check" \
|
||||
3 "$(translate "Run PVE 8 to 9 check")" \
|
||||
4 "$(translate "Manual upgrade guide step by step")" \
|
||||
3>&1 1>&2 2>&3
|
||||
); status=$?
|
||||
@@ -178,7 +178,7 @@ ask_run_mode() {
|
||||
--menu "$(translate "Choose how to perform the upgrade:")" 20 70 8 \
|
||||
"1" "$(translate "Automatic/Unattended")" \
|
||||
"2" "$(translate "Interactive (guided, prompts visible)")" \
|
||||
"3" "$(translate "Run PVE 8 to 9") check" \
|
||||
"3" "$(translate "Run PVE 8 to 9 check")" \
|
||||
"4" "$(translate "Manual upgrade guide step by step")" \
|
||||
3>&1 1>&2 2>&3
|
||||
); then
|
||||
@@ -777,7 +777,11 @@ run_pve8to9_check() {
|
||||
echo -e
|
||||
done
|
||||
echo -e
|
||||
msg_info2 "$(translate "Once finished, re-run 'PVE 8 to 9 check' to verify that all issues are resolved \n before executing the PVE 8 → PVE 9 upgrade.")"
|
||||
local check_help
|
||||
check_help="$(translate "Once finished, repeat the check ({check}) to review any remaining issues before starting the PVE 8 → PVE 9 upgrade.")"
|
||||
[[ "$check_help" == *'{check}'* ]] || check_help="Once finished, repeat the check ({check}) to review any remaining issues before starting the PVE 8 → PVE 9 upgrade."
|
||||
check_help="${check_help//\{check\}/$(translate "Run PVE 8 to 9 check")}"
|
||||
msg_info2 "$check_help"
|
||||
echo -e
|
||||
msg_success "$(translate "Press Enter to exit the script after reading instructions...")"
|
||||
read -r
|
||||
@@ -1143,7 +1147,11 @@ run_pve8to9_check2() {
|
||||
echo -e
|
||||
done
|
||||
echo -e
|
||||
msg_info2 "$(translate "Once finished, re-run the script 'PVE 8 to 9 check' to verify that all issues are resolved \n before rebooting.")"
|
||||
local check_help
|
||||
check_help="$(translate "Once finished, repeat the check ({check}) to review any remaining issues before rebooting.")"
|
||||
[[ "$check_help" == *'{check}'* ]] || check_help="Once finished, repeat the check ({check}) to review any remaining issues before rebooting."
|
||||
check_help="${check_help//\{check\}/$(translate "Run PVE 8 to 9 check")}"
|
||||
msg_info2 "$check_help"
|
||||
echo -e
|
||||
msg_success "$(translate "Press Enter to exit the script after reading instructions...")"
|
||||
read -r
|
||||
|
||||
@@ -179,7 +179,12 @@ function run_gpu_passthrough_wizard() {
|
||||
fi
|
||||
|
||||
if [[ ! -f "$gpu_script" ]]; then
|
||||
msg_warn "$(translate "GPU passthrough assistant not found. You can run it later from Hardware Graphics.")"
|
||||
local gpu_notice
|
||||
gpu_notice="$(translate "GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again.")"
|
||||
[[ "$gpu_notice" == *'{menu}'* && "$gpu_notice" == *'{action}'* ]] || gpu_notice="GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again."
|
||||
gpu_notice="${gpu_notice//\{menu\}/$(translate "Hardware: GPUs and Coral-TPU")}"
|
||||
gpu_notice="${gpu_notice//\{action\}/$(translate "Add GPU to VM (Intel | AMD | NVIDIA)")}"
|
||||
msg_warn "$gpu_notice"
|
||||
WIZARD_GPU_RESULT="cancelled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -234,7 +234,12 @@ function run_gpu_passthrough_wizard() {
|
||||
fi
|
||||
|
||||
if [[ ! -f "$gpu_script" ]]; then
|
||||
msg_warn "$(translate "GPU passthrough assistant not found. You can run it later from Hardware Graphics.")"
|
||||
local gpu_notice
|
||||
gpu_notice="$(translate "GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again.")"
|
||||
[[ "$gpu_notice" == *'{menu}'* && "$gpu_notice" == *'{action}'* ]] || gpu_notice="GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again."
|
||||
gpu_notice="${gpu_notice//\{menu\}/$(translate "Hardware: GPUs and Coral-TPU")}"
|
||||
gpu_notice="${gpu_notice//\{action\}/$(translate "Add GPU to VM (Intel | AMD | NVIDIA)")}"
|
||||
msg_warn "$gpu_notice"
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -171,7 +171,12 @@ function run_gpu_passthrough_wizard() {
|
||||
fi
|
||||
|
||||
if [[ ! -f "$gpu_script" ]]; then
|
||||
msg_warn "$(translate "GPU passthrough assistant not found. You can run it later from Hardware Graphics.")"
|
||||
local gpu_notice
|
||||
gpu_notice="$(translate "GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again.")"
|
||||
[[ "$gpu_notice" == *'{menu}'* && "$gpu_notice" == *'{action}'* ]] || gpu_notice="GPU passthrough assistant not found. Later, open {menu} → {action} from the main menu to try again."
|
||||
gpu_notice="${gpu_notice//\{menu\}/$(translate "Hardware: GPUs and Coral-TPU")}"
|
||||
gpu_notice="${gpu_notice//\{action\}/$(translate "Add GPU to VM (Intel | AMD | NVIDIA)")}"
|
||||
msg_warn "$gpu_notice"
|
||||
WIZARD_GPU_RESULT="cancelled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user