mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-15 14:28:21 +00:00
Update select_windows_iso.sh
This commit is contained in:
@@ -100,10 +100,21 @@ function select_windows_iso() {
|
|||||||
|
|
||||||
function select_existing_iso() {
|
function select_existing_iso() {
|
||||||
local volid
|
local volid
|
||||||
|
local name display_name tag storage
|
||||||
|
local selected_tag
|
||||||
|
declare -A ISO_VOLID_BY_TAG=()
|
||||||
ISO_LIST=()
|
ISO_LIST=()
|
||||||
while read -r volid; do
|
while read -r volid; do
|
||||||
[[ -z "$volid" ]] && continue
|
[[ -z "$volid" ]] && continue
|
||||||
ISO_LIST+=("$volid" "$(iso_dialog_description "$volid")")
|
name=$(iso_name_from_volid "$volid")
|
||||||
|
display_name=$(iso_display_name "$name" 58)
|
||||||
|
storage=$(iso_storage_from_volid "$volid")
|
||||||
|
tag="$display_name"
|
||||||
|
if [[ -n "${ISO_VOLID_BY_TAG[$tag]:-}" ]]; then
|
||||||
|
tag="$(iso_display_name "$name ($storage)" 58)"
|
||||||
|
fi
|
||||||
|
ISO_VOLID_BY_TAG["$tag"]="$volid"
|
||||||
|
ISO_LIST+=("$tag" "$(iso_dialog_description "$volid")")
|
||||||
done < <(iso_list_volids "windows")
|
done < <(iso_list_volids "windows")
|
||||||
|
|
||||||
if [[ ${#ISO_LIST[@]} -eq 0 ]]; then
|
if [[ ${#ISO_LIST[@]} -eq 0 ]]; then
|
||||||
@@ -113,11 +124,12 @@ function select_existing_iso() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ISO_VOLID=$(dialog --backtitle "ProxMenux" --title "$(translate "Available ISO Images")" \
|
selected_tag=$(dialog --backtitle "ProxMenux" --title "$(translate "Available ISO Images")" \
|
||||||
--menu "$(translate "Choose a Windows ISO to use:")\n\n$(printf '%-42s │ %-14s │ %s' "$(translate "ISO")" "$(translate "Storage")" "$(translate "Size")")" 22 86 12 \
|
--menu "$(translate "Choose a Windows ISO to use:")\n\n$(printf '%-58s %-10s %s' "$(translate "ISO")" "$(translate "Storage")" "$(translate "Size")")" 22 86 12 \
|
||||||
"${ISO_LIST[@]}" 3>&1 1>&2 2>&3)
|
"${ISO_LIST[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
[[ -z "$ISO_VOLID" ]] && msg_warn "$(translate "No ISO selected.")" && return 1
|
[[ -z "$selected_tag" ]] && msg_warn "$(translate "No ISO selected.")" && return 1
|
||||||
|
ISO_VOLID="${ISO_VOLID_BY_TAG[$selected_tag]}"
|
||||||
|
|
||||||
ISO_FILE=$(iso_name_from_volid "$ISO_VOLID")
|
ISO_FILE=$(iso_name_from_volid "$ISO_VOLID")
|
||||||
ISO_PATH=$(iso_volid_to_path "$ISO_VOLID")
|
ISO_PATH=$(iso_volid_to_path "$ISO_VOLID")
|
||||||
|
|||||||
Reference in New Issue
Block a user