Merge pull request #1473 from juronja/truenas-vm-whiptail-box-size-fix

Truenas-vm: Truncating text for longer checkbox items
This commit is contained in:
CanbiZ (MickLesk)
2026-02-17 20:01:24 +01:00
committed by GitHub

View File

@@ -560,10 +560,14 @@ if [ "$IMPORT_DISKS" == "yes" ]; then
SCSI_NR=0
while read -r LSOUTPUT; do
DISKARRAY+=("$LSOUTPUT" "" "OFF")
TRUNCATED="${LSOUTPUT:0:45}"
if [ ${#LSOUTPUT} -gt 45 ]; then
TRUNCATED="${TRUNCATED}..."
fi
DISKARRAY+=("$LSOUTPUT" "$TRUNCATED" "OFF")
done < <(ls /dev/disk/by-id | grep -E '^ata-|^nvme-|^usb-' | grep -v 'part')
SELECTIONS=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SELECT DISKS TO IMPORT" --checklist "\nSelect disk IDs to import. (Use Spacebar to select)\n" --cancel-button "Exit Script" 20 58 10 "${DISKARRAY[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
SELECTIONS=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SELECT DISKS TO IMPORT" --checklist "\nSelect disk IDs to import. (Use Spacebar to select)\n" --notags --cancel-button "Exit Script" 20 58 10 "${DISKARRAY[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
for SELECTION in $SELECTIONS; do
((++SCSI_NR))