This commit is contained in:
David Schroeder
2026-09-23 17:02:08 -05:00
parent fdbd08e1b0
commit cd4d505064
5 changed files with 25 additions and 26 deletions
+20 -23
View File
@@ -1004,14 +1004,14 @@ SHOW_LOCAL_VIRTIO_ISOS() {
echo
if TAPM_REFRESH_ISO_STORAGES; then
for index in "${!VIRTIO_STORAGE_IDS[@]}"; do
echo -e " ${idsCL[LightCyan]}${VIRTIO_STORAGE_IDS[$index]}${idsCL[Default]} (${VIRTIO_STORAGE_TYPES[$index]})"
echo " ${VIRTIO_STORAGE_DIRS[$index]}"
TAPM_UI_TEXT "$TAPM_UI_ACCENT" "${VIRTIO_STORAGE_IDS[$index]} (${VIRTIO_STORAGE_TYPES[$index]})"
TAPM_UI_TEXT "$TAPM_UI_MUTED" "${VIRTIO_STORAGE_DIRS[$index]}"
while IFS= read -r -d '' file; do
found=1
printf ' %-42s %10s %s\n' \
"${file##*/}" \
"$(numfmt --to=iec-i --suffix=B "$(stat -c '%s' "$file")")" \
"$(date --date="@$(stat -c '%Y' "$file")" '+%F %R')"
TAPM_UI_TEXT "$TAPM_UI_BOLD" "${file##*/}"
TAPM_UI_TEXT '' " Size: $(numfmt --to=iec-i --suffix=B "$(stat -c '%s' "$file")")"
TAPM_UI_TEXT "$TAPM_UI_MUTED" " Modified: $(date --date="@$(stat -c '%Y' "$file")" '+%F %R')"
done < <(
find "${VIRTIO_STORAGE_DIRS[$index]}" -maxdepth 1 -type f \
-name 'virtio-win*.iso' -print0 2>/dev/null | sort -z
@@ -1262,6 +1262,7 @@ print(" ".join(model.split()))
}
TAPM_SHOW_CLUSTER_CPU_TABLE() {
TAPM_UI_INIT
local proxclmc_output
local host_rows
local node
@@ -1280,11 +1281,6 @@ TAPM_SHOW_CLUSTER_CPU_TABLE() {
return 0
fi
printf ' %-16s %-42s %-34s %-14s\n' \
'HOST' 'PHYSICAL CPU' 'GENERATION / FAMILY' 'BEST VM MODEL'
printf ' %-16s %-42s %-34s %-14s\n' \
'----------------' '------------------------------------------' \
'----------------------------------' '--------------'
while IFS=$'\034' read -r node address host_max; do
[[ -n "$node" ]] || continue
@@ -1297,12 +1293,16 @@ TAPM_SHOW_CLUSTER_CPU_TABLE() {
generation='Unavailable'
fi
printf ' %-16.16s %-42.42s %-34.34s %-14s\n' \
"$node" "$cpu_name" "$generation" "$host_max"
TAPM_UI_TEXT "$TAPM_UI_BOLD" "$node"
TAPM_UI_TEXT '' " Physical CPU: $cpu_name"
TAPM_UI_TEXT '' " Generation / family: $generation"
TAPM_UI_TEXT '' " Best VM model: $host_max"
echo
done <<< "$host_rows"
}
DETECT_CPU() {
TAPM_UI_INIT
local answer
local cpu_model
local current_cpu
@@ -1379,15 +1379,15 @@ DETECT_CPU() {
return
fi
printf '\n%-7s %-28s %-20s %-10s %-24s %s\n' \
'VMID' 'NAME' 'NODE' 'TEMPLATE' 'CURRENT CPU' 'PROPOSED CPU'
printf '%-7s %-28s %-20s %-10s %-24s %s\n' \
'-------' '----------------------------' '--------------------' \
'----------' '------------------------' '----------------'
echo
TAPM_UI_TEXT "$TAPM_UI_BOLD" 'Proposed CPU changes'
for guest in "${changes[@]}"; do
IFS=$'\x1f' read -r vmid name node template current_cpu <<< "$guest"
printf '%-7s %-28.28s %-20.20s %-10s %-24.24s %s\n' \
"$vmid" "${name:-unnamed}" "$node" "$template" "$current_cpu" "$cpu_model"
TAPM_UI_TEXT "$TAPM_UI_BOLD" "${name:-unnamed} (VM $vmid)"
TAPM_UI_TEXT '' " Node: $node Template: $template"
TAPM_UI_TEXT '' " Current CPU: $current_cpu"
TAPM_UI_TEXT '' " Proposed CPU: $cpu_model"
echo
done
echo -en "\n${idsCL[LightCyan]}Apply cluster-wide baseline ${cpu_model} to ${#changes[@]} VM(s) and template(s) (y/N)?${idsCL[Default]} "
@@ -1766,9 +1766,6 @@ MENU_HEADER() {
local version="${VERS}" spacing host
host="$(hostname -s)"
TAPM_UI_INIT
# Keep the header compact without changing the menu's available width.
local TAPM_UI_WIDTH="$TAPM_UI_WIDTH"
(( TAPM_UI_WIDTH > 75 )) && TAPM_UI_WIDTH=75
TAPM_LOAD_HEADER_INFO
if [[ "$UPDATE_STATUS" == unknown || "$UPDATE_STATUS" == checking ]]; then
LOAD_UPDATE_STATUS