ui: network-monitor status on its own line + Refresh translation (v2.7.3)

The location line in the Phone-tab network monitor grew too long once the
status was appended (e.g. "262-01 · Germany · Telekom · Guest (roaming)
 PLMN not allowed").  netStateRender now keeps the identity
(mcc-mnc · country · operator) on the first line and renders the status
elements (roaming tag + forbidden badge) in a block span on a second line;
a location without a status still renders on one line.

Also add the missing Russian translation for the monitor's Refresh button
(t() fell back to English): 'Refresh': 'Обновить'.

- frontend/index.html: two-line location render, LANG_RU Refresh, 2.7.3
- frontend/tests/netstate.test.js: pins the block-span layout and the
  one-line no-status case
- sw.js cache simple-v206; version trio 2.7.3
This commit is contained in:
2026-09-20 13:34:21 +03:00
parent 6bea10bb5b
commit cd802d965e
5 changed files with 22 additions and 6 deletions
+6 -3
View File
@@ -1414,7 +1414,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.2';
const SIMPLE_VERSION = '2.7.3';
document.getElementById('app-version').textContent = 'v' + SIMPLE_VERSION;
// ===== Tab switching =====
@@ -12643,11 +12643,13 @@ function netStateRender(state) {
const loc = state && state.network ? state.network.location : null;
const locEl = document.getElementById('netstate-location');
if (loc) {
const statuses = [];
if (loc.roaming) statuses.push(esc(t(NET_STATE_ROAMING[loc.roaming] || loc.roaming)));
if (loc.rejected) statuses.push('<span class="text-red-500">⛔ ' + esc(t('PLMN not allowed')) + '</span>');
let h = '<span class="font-mono">' + esc(loc.mcc + '-' + loc.mnc) + '</span>';
if (loc.country) h += ' · ' + esc(loc.country);
if (loc.operator) h += ' · ' + esc(loc.operator);
if (loc.roaming) h += ' · ' + esc(t(NET_STATE_ROAMING[loc.roaming] || loc.roaming));
if (loc.rejected) h += ' <span class="text-red-500">⛔ ' + esc(t('PLMN not allowed')) + '</span>';
if (statuses.length) h += '<span class="block">' + statuses.join(' · ') + '</span>';
locEl.innerHTML = h;
} else {
locEl.innerHTML = '<span class="text-gray-400"></span>';
@@ -12949,6 +12951,7 @@ const LANG_RU = {
'pySim command line': 'Командная строка pySim',
'Raw APDU': 'Отправка APDU',
'Read': 'Прочитать',
'Refresh': 'Обновить',
'Save': 'Сохранить',
'Raw': 'Данные как на карте',
'Decoded': 'Декодированные данные',
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE = 'simple-v205';
const CACHE = 'simple-v206';
const URLS = [
'index.html',
'help.html',
+13
View File
@@ -106,12 +106,25 @@ test('netStateRender paints the service badge, location and rows', () => {
assert.ok(els['netstate-location'].innerHTML.includes('Germany'));
assert.ok(els['netstate-location'].innerHTML.includes('Guest (roaming)'));
assert.ok(els['netstate-location'].innerHTML.includes('PLMN not allowed'));
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.ok(els['netstate-body'].innerHTML.includes('EF.IMSI'));
assert.ok(els['netstate-body'].innerHTML.includes('262011234567890'));
assert.ok(els['netstate-body'].innerHTML.includes('>write<'));
});
test('netStateRender keeps the location on one line when there is no status', () => {
const els = setup();
decoder({});
netStateRender({ service: { state: 'normal' }, files: {},
network: { location: { mcc: '262', mnc: '01', country: 'Germany',
operator: 'Telekom', area: 'LAI', lac: '6CD7' } } });
assert.strictEqual(els['netstate-location'].innerHTML,
'<span class="font-mono">262-01</span> · Germany · Telekom');
});
test('netStateRender shows Undefined until something is simulated', () => {
const els = setup();
decoder({});
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pysim-simple-server"
version = "2.7.2"
version = "2.7.3"
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.
+1 -1
View File
@@ -25,7 +25,7 @@ from osmocom.construct import GsmOrUcs2Adapter
from osmocom.tlv import BER_TLV_IE
VERSION = '2.7.2'
VERSION = '2.7.3'
MAX_ENVELOPE_SEGMENTS = 5 # max SMS segments for outgoing C-APDU in ENVELOPE