From fdbd08e1b0352ac6dc160e32cb4fbcd22b3bb896 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 22 Sep 2026 23:15:29 -0500 Subject: [PATCH] header fix --- defaults.inc | 2 +- proxmenu-scripts.sh | 3 +++ tests/test-ui.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index 00a3d9d..6bc9ba6 100755 --- a/defaults.inc +++ b/defaults.inc @@ -3,7 +3,7 @@ action="${1:-}" FOLDER='/opt/idssys/ta-proxmenu' -VERS='2026.9.22-16' +VERS='2026.9.22-17' noupdate=' ' diff --git a/proxmenu-scripts.sh b/proxmenu-scripts.sh index e4ca27d..65a22e7 100755 --- a/proxmenu-scripts.sh +++ b/proxmenu-scripts.sh @@ -1766,6 +1766,9 @@ 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 diff --git a/tests/test-ui.py b/tests/test-ui.py index a5d5af9..ef7b0d0 100644 --- a/tests/test-ui.py +++ b/tests/test-ui.py @@ -53,7 +53,7 @@ TAPM_UI_TASK 'Find orphaned and unused disks' def test_header_widths(self): source = (ROOT / 'proxmenu-scripts.sh').read_text() header = 'MENU_HEADER() {' + source.split('MENU_HEADER() {', 1)[1].split('\nSELECT_MENU()', 1)[0] - for width in (40, 80): + for width in (40, 80, 120): with self.subTest(width=width): output = self.shell(''' TAPM_LOAD_HEADER_INFO() { TAPM_HEADER_PVE_VERSION=9.2.20; TAPM_HEADER_CLUSTER=Home-Cluster; } @@ -64,7 +64,7 @@ UPDATE_STATUS=current VERS=2026.9.22-15 RNIP=10.10.2.12 self.assertIn('TA-ProxMenu', output) self.assertIn('Home-Cluster', output) self.assertIn('Up to date', output) - self.assertTrue(all(len(line) <= width for line in output.splitlines())) + self.assertTrue(all(len(line) <= min(width, 75) for line in output.splitlines())) def test_report_is_plain_when_redirected(self): rows = [dict(node='shared (via ids-vms1)', storage='iSCSI-Datastore2',