ui: drop the network-monitor area line, label the refresh time (v2.7.5)
The second line under the location (e.g. "RAI FFFE") showed only the LAC
part of the current area identity: after every dummy-writing scenario it
was the constant FFFE, and otherwise it was redundant with the
EF.LOCI/PSLOCI/EPSLOCI rows below. netStateRender no longer renders it.
The timestamp line now carries a translated "Last refresh" label
('Last refresh': 'Последнее обновление').
- frontend/index.html: remove #netstate-area (markup + render), label the
read time, LANG_RU entry
- frontend/tests: html test pins the label and the absence of the area
line; netstate test asserts the rendered timestamp
- sw.js cache simple-v208; version trio 2.7.5
This commit is contained in:
+3
-4
@@ -1036,8 +1036,7 @@
|
||||
<button id="netstate-refresh-btn" data-needs="card" onclick="netStateRefresh()" class="px-2 py-0.5 text-xs rounded bg-gray-200 dark:bg-slate-700 text-gray-700 dark:text-slate-300 hover:bg-gray-300 dark:hover:bg-slate-600 disabled:opacity-40 disabled:cursor-not-allowed" data-l10n="Refresh">Refresh</button>
|
||||
</div>
|
||||
<div id="netstate-location" class="text-xs font-mono text-gray-600 dark:text-slate-400"></div>
|
||||
<div id="netstate-area" class="text-xs font-mono text-gray-400 dark:text-slate-500"></div>
|
||||
<div id="netstate-read" class="text-xs text-gray-400 dark:text-slate-500 mt-1"></div>
|
||||
<div class="text-xs text-gray-400 dark:text-slate-500 mt-1"><span data-l10n="Last refresh">Last refresh</span>: <span id="netstate-read"></span></div>
|
||||
<div id="netstate-body" class="mt-2 text-xs font-mono text-gray-600 dark:text-slate-400 max-h-[45vh] overflow-auto"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -1414,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.4';
|
||||
const SIMPLE_VERSION = '2.7.5';
|
||||
document.getElementById('app-version').textContent = 'v' + SIMPLE_VERSION;
|
||||
|
||||
// ===== Tab switching =====
|
||||
@@ -12654,7 +12653,6 @@ function netStateRender(state) {
|
||||
} else {
|
||||
locEl.innerHTML = '<span class="text-gray-400">—</span>';
|
||||
}
|
||||
document.getElementById('netstate-area').textContent = loc ? (loc.area + ' ' + loc.lac) : '';
|
||||
document.getElementById('netstate-read').textContent =
|
||||
state && state.read_at ? new Date(state.read_at * 1000).toLocaleTimeString() : '';
|
||||
const files = (state && state.files) || {};
|
||||
@@ -12952,6 +12950,7 @@ const LANG_RU = {
|
||||
'Raw APDU': 'Отправка APDU',
|
||||
'Read': 'Прочитать',
|
||||
'Refresh': 'Обновить',
|
||||
'Last refresh': 'Последнее обновление',
|
||||
'Save': 'Сохранить',
|
||||
'Raw': 'Данные как на карте',
|
||||
'Decoded': 'Декодированные данные',
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
const CACHE = 'simple-v207';
|
||||
const CACHE = 'simple-v208';
|
||||
const URLS = [
|
||||
'index.html',
|
||||
'help.html',
|
||||
|
||||
@@ -293,3 +293,8 @@ test('SCP81 listener exposes its four modes with the matching notes', () => {
|
||||
assert.ok(html.includes("mode === 'redirect' && (!hostVal || !portVal)"));
|
||||
assert.ok(html.includes("el.disabled = (mode === 'passthru')"));
|
||||
});
|
||||
|
||||
test('the network monitor labels its refresh timestamp and has no area line', () => {
|
||||
assert.match(html, /data-l10n="Last refresh">Last refresh<\/span>: <span id="netstate-read"><\/span>/);
|
||||
assert.ok(!/id="netstate-area"/.test(html), 'the area line is gone; LAI/RAI/TAI live in the EF rows');
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ eval(code);
|
||||
|
||||
function setup() {
|
||||
const els = {};
|
||||
for (const id of ['netstate-badge', 'netstate-location', 'netstate-area',
|
||||
for (const id of ['netstate-badge', 'netstate-location',
|
||||
'netstate-read', 'netstate-body']) {
|
||||
els[id] = { className: '', textContent: '', innerHTML: '' };
|
||||
}
|
||||
@@ -109,7 +109,7 @@ test('netStateRender paints the service badge, location and rows', () => {
|
||||
assert.ok(els['netstate-location'].innerHTML.includes(
|
||||
'Telekom<span class="block">Guest (roaming) · <span class="text-red-500">⛔ PLMN not allowed</span></span>'));
|
||||
assert.ok(!els['netstate-location'].innerHTML.includes('Telekom · '));
|
||||
assert.strictEqual(els['netstate-area'].textContent, 'LAI 6CD7');
|
||||
assert.strictEqual(els['netstate-read'].textContent, new Date(1700000000 * 1000).toLocaleTimeString());
|
||||
assert.ok(els['netstate-body'].innerHTML.includes('EF.IMSI'));
|
||||
assert.ok(els['netstate-body'].innerHTML.includes('262011234567890'));
|
||||
assert.ok(els['netstate-body'].innerHTML.includes('>write<'));
|
||||
|
||||
Reference in New Issue
Block a user