This commit is contained in:
David Schroeder
2026-09-22 22:44:37 -05:00
parent e262260358
commit 31bc775e8f
5 changed files with 20 additions and 12 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ Shared storage IDs are scanned once; local storage remains scoped to its node.
Results are grouped by node and storage, with volume IDs and disk Results are grouped by node and storage, with volume IDs and disk
sizes in readable units (MiB, GiB, or TiB). CSV includes both `disk_size` and sizes in readable units (MiB, GiB, or TiB). CSV includes both `disk_size` and
`size_bytes`. When Proxmox supplies only `approximate-size`, the display and CSV `size_bytes`. When Proxmox supplies only `approximate-size`, the display and CSV
show a `~` prefix and CSV sets `size_is_approximate` to `True`. Exact sizes take show a `~` prefix. Exact sizes take
precedence; unavailable sizes are displayed as `Unknown`. precedence; unavailable sizes are displayed as `Unknown`.
Backups, ISOs, unmanaged files, and physical/passthrough disks are excluded. Backups, ISOs, unmanaged files, and physical/passthrough disks are excluded.
+1 -1
View File
@@ -3,7 +3,7 @@
action="${1:-}" action="${1:-}"
FOLDER='/opt/idssys/ta-proxmenu' FOLDER='/opt/idssys/ta-proxmenu'
VERS='2026.9.22-11' VERS='2026.9.22-13'
noupdate=' ' noupdate=' '
+5 -2
View File
@@ -219,10 +219,13 @@ def export_csv(path, rows):
suffix += 1 suffix += 1
destination = base.with_name(f'{base.stem}-{suffix}.csv') destination = base.with_name(f'{base.stem}-{suffix}.csv')
with handle: with handle:
writer = csv.DictWriter(handle, fieldnames=FIELDS + ['disk_size']) export_fields = [field for field in FIELDS if field != 'size_is_approximate']
writer = csv.DictWriter(handle, fieldnames=export_fields + ['disk_size'])
writer.writeheader() writer.writeheader()
for row in rows: for row in rows:
writer.writerow(dict(row, disk_size=format_size(row['size_bytes'], row.get('size_is_approximate', False)))) exported = {field: row.get(field) for field in export_fields}
exported['disk_size'] = format_size(row['size_bytes'], row.get('size_is_approximate', False))
writer.writerow(exported)
return destination return destination
+12 -7
View File
@@ -1880,13 +1880,13 @@ SELECT_MENU() {
"") "")
MENU_INPUT="enter" MENU_INPUT="enter"
MENU_SELECTION="${values_ref[$selected]}" MENU_SELECTION="${values_ref[$selected]}"
return 0 break
;; ;;
" ") " ")
if (( allow_space == 1 )); then if (( allow_space == 1 )); then
MENU_INPUT="space" MENU_INPUT="space"
MENU_SELECTION="${values_ref[$selected]}" MENU_SELECTION="${values_ref[$selected]}"
return 0 break
fi fi
;; ;;
[1-9]) [1-9])
@@ -1896,17 +1896,17 @@ SELECT_MENU() {
MENU_SELECTED_INDEX="$selected" MENU_SELECTED_INDEX="$selected"
MENU_INPUT="number" MENU_INPUT="number"
MENU_SELECTION="${values_ref[$index]}" MENU_SELECTION="${values_ref[$index]}"
return 0 break
fi fi
;; ;;
[Qq]) [Qq])
MENU_SELECTION="quit" MENU_SELECTION="quit"
return 0 break
;; ;;
[Bb]) [Bb])
if (( allow_back == 1 )); then if (( allow_back == 1 )); then
MENU_SELECTION="back" MENU_SELECTION="back"
return 0 break
fi fi
;; ;;
$'\e') $'\e')
@@ -1921,12 +1921,12 @@ SELECT_MENU() {
;; ;;
"[C"|"OC") "[C"|"OC")
MENU_SELECTION="${values_ref[$selected]}" MENU_SELECTION="${values_ref[$selected]}"
return 0 break
;; ;;
"[D"|"OD"|"") "[D"|"OD"|"")
if (( allow_back == 1 )); then if (( allow_back == 1 )); then
MENU_SELECTION="back" MENU_SELECTION="back"
return 0 break
fi fi
;; ;;
"[H") "[H")
@@ -1939,6 +1939,11 @@ SELECT_MENU() {
;; ;;
esac esac
done done
# Leave only the header above the selected action's output.
MENU_HEADER
echo
return 0
} }
TAPM_POST_PROFILE_SUMMARY() { TAPM_POST_PROFILE_SUMMARY() {
+1 -1
View File
@@ -165,7 +165,7 @@ class ReportTests(unittest.TestCase):
self.assertEqual([row['disk_size'] for row in exported], self.assertEqual([row['disk_size'] for row in exported],
['~25.91 GiB', '30.00 GiB', '0.00 B', '~25.91 GiB', 'Unknown']) ['~25.91 GiB', '30.00 GiB', '0.00 B', '~25.91 GiB', 'Unknown'])
self.assertEqual(exported[0]['size_bytes'], str(approximate)) self.assertEqual(exported[0]['size_bytes'], str(approximate))
self.assertEqual(exported[0]['size_is_approximate'], 'True') self.assertNotIn('size_is_approximate', exported[0])
def test_offline_node_and_config_change(self): def test_offline_node_and_config_change(self):
def get(path, *options): def get(path, *options):