Merge pull request #1473 from juronja/truenas-vm-whiptail-box-size-fix
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Crawl Versions from newreleases.io / crawl-versions (push) Has been cancelled
Crawl Versions from github / crawl-versions (push) Has been cancelled
Update Versions from GitHub / update-versions (push) Has been cancelled
Stale PR Management / stale-prs (push) Has been cancelled
Cleanup Branches (Merged or Closed) / cleanup (push) Has been cancelled

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
commit 8c6f285853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -560,10 +560,14 @@ if [ "$IMPORT_DISKS" == "yes" ]; then
SCSI_NR=0 SCSI_NR=0
while read -r LSOUTPUT; do 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') 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 for SELECTION in $SELECTIONS; do
((++SCSI_NR)) ((++SCSI_NR))