header fix
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
action="${1:-}"
|
||||
FOLDER='/opt/idssys/ta-proxmenu'
|
||||
VERS='2026.9.22-16'
|
||||
VERS='2026.9.22-17'
|
||||
|
||||
noupdate=' '
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user