diff --git a/frontend/index.html b/frontend/index.html index 4d7cb67..9297c44 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1413,7 +1413,7 @@ // ===== Version ===== // Single source of truth for the PWA version: shown in the header and used // by the server version check in pysimConnect(). -const SIMPLE_VERSION = '2.7.13'; +const SIMPLE_VERSION = '2.7.14'; document.getElementById('app-version').textContent = 'v' + SIMPLE_VERSION; // ===== Tab switching ===== @@ -12634,13 +12634,15 @@ function efDataSummary(data) { return ''; } +// Decoded field rows: the label column is sized to its content (grid +// max-content) instead of a fixed width, so values start right after the +// widest label and short labels do not push the data far to the right. function efRenderFieldsHtml(rows) { if (!rows.length) return '' + esc(t('No decodable fields')) + ''; - let html = '
'; + let html = '
'; for (const [k, v] of rows) { - html += '
' + - '' + esc(k) + '' + - '' + esc(v) + '
'; + html += '' + esc(k) + '' + + '' + esc(v) + ''; } return html + '
'; } diff --git a/frontend/sw.js b/frontend/sw.js index 6b95b70..6ed5715 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simple-v216'; +const CACHE = 'simple-v217'; const URLS = [ 'index.html', 'help.html', diff --git a/frontend/tests/ef_decode.test.js b/frontend/tests/ef_decode.test.js index 2fa49d0..01e32ab 100644 --- a/frontend/tests/ef_decode.test.js +++ b/frontend/tests/ef_decode.test.js @@ -214,12 +214,25 @@ test('file manager decoded view renders fields, not JSON', () => { assert.match(out, /228062800000208/); assert.match(out, /pySim JSON \(server\)/); assert.doesNotMatch(out, /\{"imsi"/); + // the label column is content-sized, not a fixed 10rem block + assert.match(out, /grid-template-columns:max-content 1fr/); + assert.doesNotMatch(out, /w-40/); // no decoder -> raw fallback with a note const raw = pysimFsDecodedHtml({ name: 'EF.NOPE', fid: 'abcd' }, { success: true, data: '0011' }); assert.match(raw, /No decoder for this file/); assert.match(raw, /0011/); }); +test('efRenderFieldsHtml sizes the label column to its content', () => { + const out = efRenderFieldsHtml([['ICCID', '8988'], ['Very long label', 'x']]); + assert.match(out, /style="display:grid;grid-template-columns:max-content 1fr/); + assert.doesNotMatch(out, /w-40/); + assert.ok(out.includes('>ICCID')); + assert.ok(out.includes('>8988')); + assert.ok(out.includes('>Very long label')); + assert.match(efRenderFieldsHtml([]), /No decodable fields/); +}); + test('profilerRenderReport shows decoded field diffs and the raw-only note', () => { const res = { path: 'ADF.USIM/6F07', name: 'EF.IMSI', status: 'fail', diff --git a/pyproject.toml b/pyproject.toml index 470dcd6..09249ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pysim-simple-server" -version = "2.7.13" +version = "2.7.14" description = "HTTP REST server wrapping pysim for the SIMple PWA" requires-python = ">=3.8" # pysim is a git-only dependency installed explicitly by setup.bat/setup.sh. diff --git a/pysim_simple_server/server.py b/pysim_simple_server/server.py index 0565336..ccd1f60 100644 --- a/pysim_simple_server/server.py +++ b/pysim_simple_server/server.py @@ -26,7 +26,7 @@ from osmocom.tlv import BER_TLV_IE from osmocom.utils import rpad -VERSION = '2.7.13' +VERSION = '2.7.14' MAX_ENVELOPE_SEGMENTS = 5 # max SMS segments for outgoing C-APDU in ENVELOPE