From b92a47cd44513cf31b5714d54523cf2d99649d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Sun, 27 Sep 2026 19:25:47 +0300 Subject: [PATCH] fix: close the eSIM panel so the Test script pill shows its panel (v3.6.1) #phone-sub-esim was missing its closing before #phone-sub-test, so the browser parsed the test panel (and everything after) as a child of the eSIM panel. Clicking Test script unhid the panel itself, but its hidden ancestor kept it invisible - the pill has never shown a panel in a real browser since it was added (v3.5.11). The eSIM LPA pill conversely showed the whole test editor below its own fields. The old whole-file div-count test stayed green because the inline script's template strings happen to contain one extra ; the real markup was 409 opens vs 408 closes. - add the missing . - html.test.js: count divs on the markup only (scripts excluded) and add a structural walk (stray end tags, cross-nesting, unclosed elements, HTML optional end tags honoured) over index.html, help.html and help-ru.html, plus a Simulator-panel sibling-depth check. Run this for every HTML edit. - the walk immediately found the same class of bug in both help pages: six unclosed
chapters each; closed them. - AGENTS: the HTML structure test is now part of the working conventions. 602 frontend / 482 Python green; version 3.6.1; sw simple-v274. --- frontend/help-ru.html | 7 +++ frontend/help.html | 7 +++ frontend/index.html | 5 +- frontend/sw.js | 2 +- frontend/tests/html.test.js | 110 +++++++++++++++++++++++++++++++++- pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 7 files changed, 127 insertions(+), 8 deletions(-) diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 1598561..99c3812 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -49,6 +49,7 @@ +

2. Вкладка Remote APDU

Построение командных APDU (C-APDU). Шесть подвкладок охватывают разные поколения карт, наборы команд и инструменты разбора: SIM RFM, USIM RFM, RAM/GP, Expanded Script, «Пуш/триггер» и «Разбор» — последняя содержит подвкладки «Разбор C-APDU» и «Разбор R-APDU».

@@ -275,6 +276,7 @@ +

3. Вкладка SCP80

Верхнеуровневая вкладка SCP80 объединяет разделы, связанные с SCP80. Переключение — двумя переключателями: Secured Packet и RAM. Собирает защищённые пакеты SCP80 по ETSI TS 102 225. При подключении карты сервер читает её EF.ICCID (2FE2); если в предустановке указан тот же номер (цифрами или сырым hex из EF), она автоматически выбирается в обоих представлениях.

@@ -334,6 +336,7 @@

Удаление подтверждается через диалог браузера перед отправкой команды GP DELETE через SCP80. Обзор автоматически обновляется после успешного удаления.

+

4. Вкладка «Карты»

Хранит предустановки карт локально в браузере (localStorage), чтобы представление Secured Packet могло автоматически подставлять ключи и параметры, а слушатель SCP81 HTTP OTA — находить PSK-ключи. «Карты» — верхнеуровневая вкладка. При подключении карты читается её EF.ICCID, и предустановка с тем же ICCID автоматически выбирается в обоих представлениях SCP80. Поля формы сгруппированы в два блока с рамкой: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, TAR-ы ISD/UICC RFM/ADF RFM, счётчик и ключи) и SCP81 (HTTP OTA) (пара PSK identity/ключ с пояснением о выборе ключа). Необязательное поле ADM находится в верхней строке и сохраняется для последующего использования файловым менеджером. В шапке отображаются серые маркеры SCP80/SCP81 и значок ключа на бейдже ADM, когда в предустановке с ICCID подключённой карты эти поля заполнены.

@@ -439,6 +442,7 @@ +

7. Профайлер

Проверяет соответствие карты именованному профилю — упорядоченному набору правил, описывающих ожидаемую файловую систему и (опционально) содержимое файлов. Профили хранятся в localStorage.

@@ -622,6 +626,7 @@ pysim-simple-server --http-port 8080

Если PWA раздаётся с публичного HTTPS-хоста (например, https://simple.example.com), для доступа к локальному серверу карт нужны два условия: (1) сервер отвечает на preflight заголовком Access-Control-Allow-Private-Network: true (pysim-simple-server ≥ 1.6.1 делает это автоматически), и (2) браузеру должно быть разрешено обращаться к локальной сети — в Chrome/Edge/Vivaldi: Настройки сайта → Доступ к локальной сети → разрешить сайт (или подтвердить запрос). Без разрешения браузера запрос к 127.0.0.1 блокируется ещё до отправки preflight.

+

10. Совместимость версий

@@ -635,6 +640,8 @@ pysim-simple-server --http-port 8080

PWA проверяет версию сервера при подключении через GET /api/version и сравнивает мажорную версию (например, PWA 3.x с сервером 3.x; сервер 2.x помечается как устаревший).

+ + diff --git a/frontend/help.html b/frontend/help.html index e3c3a40..ef9cdce 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -49,6 +49,7 @@ +

2. Remote APDU tab

Builds command APDUs (C-APDUs). Six sub-tabs cover different card generations, command sets and decoding tools: SIM RFM, USIM RFM, RAM/GP, Expanded Script, Push commands, and Parser — the last with the C-APDU Parser and R-APDU parser sub-pills.

@@ -274,6 +275,7 @@ +

3. SCP80 tab

The SCP80 top-level tab groups the SCP80-related views. It is switched by two pills: Secured Packet and RAM. Assembles SCP80 secured packets per ETSI TS 102 225. When a card is equipped the server reads its EF.ICCID (2FE2); if a card preset carries the same number (digits, or the raw EF hex), it is selected automatically in both views.

@@ -333,6 +335,7 @@

Delete confirms via a browser prompt before sending the GP DELETE command via SCP80. The explorer auto-refreshes after a successful deletion.

+

4. Cards tab

Stores card presets locally in the browser (localStorage) so the Secured Packet view can auto-fill keys and parameters, and so the SCP81 HTTP OTA listener can look up PSK keys. Cards is a top-level tab. When the card is equipped its EF.ICCID is read and the preset with the same ICCID is selected automatically in both SCP80 views. The form groups the fields into two bordered blocks: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, the ISD/UICC RFM/ADF RFM TARs, counter and keys) and SCP81 (HTTP OTA) (the PSK identity/key pair with the key-selection note). The optional ADM field sits in the top row and is stored for later use by the file manager. The header shows gray SCP80/SCP81 markers and a key glyph on the ADM badge when the preset matching the equipped card's ICCID has those settings filled in.

@@ -438,6 +441,7 @@ +

7. Profiler

Verifies that a card matches a named profile — an ordered set of rules describing the expected file system and (optionally) file contents. Profiles are stored in localStorage.

@@ -621,6 +625,7 @@ pysim-simple-server --http-port 8080

If the PWA is served from a public HTTPS host (e.g. https://simple.example.com), two things are required to reach a local card server: (1) the server must answer the preflight with Access-Control-Allow-Private-Network: true (pysim-simple-server ≥ 1.6.1 does this automatically), and (2) the browser must be allowed to access the local network — in Chrome/Edge/Vivaldi: Site settings → Local network access → allow the site (or accept the permission prompt). Without the browser permission, the request to 127.0.0.1 is blocked before any preflight is sent.

+

10. Version compatibility

@@ -634,6 +639,8 @@ pysim-simple-server --http-port 8080

The PWA checks the server version on connect via GET /api/version and compares the major version (e.g. 3.x PWA with a 3.x server; a 2.x server is flagged as outdated).

+ + diff --git a/frontend/index.html b/frontend/index.html index 0a752ab..4c2f703 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1245,7 +1245,8 @@
- +