From 9363f209eeb31c8813b6aea015ee4afcea138c8f 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: Sat, 12 Sep 2026 14:17:48 +0300 Subject: [PATCH] ui: split Phone simulator into Phone and TR Config pills - Phone pill: STK menu, STATUS and polling and the subscribed-events list in one row, proactive command log full-width below (room for more elements) - TR Config pill: response data injected into TERMINAL RESPONSEs; currently the PROVIDE LOCAL INFORMATION dictionary, structured as heading + body blocks for future proactive-command responses - phoneSwitchSubtab() mirrors the other sub-tab switchers and sets help anchors stk-menu / pli-dict; switchTab('phone') always opens Phone - refreshDynamicI18n renders only the visible phone panel - help EN/RU section 6 regrouped (6.4 STATUS polling under Phone, 6.5 TR Config response data), READMEs and AGENTS.md updated - structural and behavioral tests (html.test.js, phone_tabs.test.js); SW cache v93 -> v94 --- README.md | 4 +- README_RUS.md | 4 +- frontend/help-ru.html | 12 ++--- frontend/help.html | 12 ++--- frontend/index.html | 82 ++++++++++++++++++++++-------- frontend/sw.js | 2 +- frontend/tests/html.test.js | 7 +++ frontend/tests/phone_tabs.test.js | 83 +++++++++++++++++++++++++++++++ 8 files changed, 167 insertions(+), 39 deletions(-) create mode 100644 frontend/tests/phone_tabs.test.js diff --git a/README.md b/README.md index 9b50ae3..19adcd5 100644 --- a/README.md +++ b/README.md @@ -542,7 +542,7 @@ The list view has two tabs — **Profiles** and **Card snapshots**. A snapshot i ## Phone simulator -The **Phone simulator** tab provides real-time CAT session interaction: +The **Phone simulator** tab provides real-time CAT session interaction. It has two pills: **Phone** (STK menu, STATUS and polling, subscribed events, proactive command log) and **TR Config** (response data injected into TERMINAL RESPONSEs for proactive commands). **Subscribed Events** — the card's SET UP EVENT LIST is displayed with per-event **Send** buttons. Clicking opens a form specific to the event type: @@ -557,7 +557,7 @@ The **Phone simulator** tab provides real-time CAT session interaction: **Proactive Command Log** — chronological list of proactive commands encountered (seconds elapsed, type code, name, byte count). Covers SET UP MENU, SET UP EVENT LIST, POLL INTERVAL, DISPLAY TEXT, SELECT ITEM, and PROVIDE LOCAL INFORMATION. -**PLI Data Dictionary** — editable per-qualifier hex values for all 22 PROVIDE LOCAL INFORMATION qualifiers (TS 102 223 + TS 131 111). 10 qualifiers have inline decode/encode forms (toggle): +**TR Config: PLI data dictionary** — editable per-qualifier hex values for all 22 PROVIDE LOCAL INFORMATION qualifiers (TS 102 223 + TS 131 111). 10 qualifiers have inline decode/encode forms (toggle): | Code | Decoded fields | |------|--------------| diff --git a/README_RUS.md b/README_RUS.md index 7d925be..c515057 100644 --- a/README_RUS.md +++ b/README_RUS.md @@ -516,7 +516,7 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на ## Симулятор телефона -Вкладка **«Симулятор телефона»** обеспечивает взаимодействие с CAT-сессией в реальном времени: +Вкладка **«Симулятор телефона»** обеспечивает взаимодействие с CAT-сессией в реальном времени. Две подвкладки: **«Телефон»** (меню STK, STATUS и опрос, подписанные события, журнал проактивных команд) и **«Конфигурация TR»** (данные ответов, подставляемые в TERMINAL RESPONSE для проактивных команд). **Subscribed Events** — список событий SET UP EVENT LIST с кнопками **Send**. Клик открывает форму для конкретного типа события: @@ -527,7 +527,7 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на **Proactive Command Log** — хронологический список проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор. -**PLI Data Dictionary** — редактируемые hex-значения для всех 22 квалификаторов PROVIDE LOCAL INFORMATION (TS 102 223 + TS 131 111). 10 квалификаторов имеют встроенные формы декодирования/кодирования: +**Конфигурация TR: словарь PLI** — редактируемые hex-значения для всех 22 квалификаторов PROVIDE LOCAL INFORMATION (TS 102 223 + TS 131 111). 10 квалификаторов имеют встроенные формы декодирования/кодирования: | Код | Декодированные поля | |------|--------------| diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 04a14f4..e256e21 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -408,9 +408,9 @@

6. Симулятор телефона

-

Работа с сессией Card Application Toolkit: меню STK, подписанные события, журнал проактивных команд, словарь данных PROVIDE LOCAL INFORMATION и опрос STATUS.

+

Работа с сессией Card Application Toolkit. Две подвкладки: «Телефон» (меню STK, STATUS и опрос, подписанные события, журнал проактивных команд) и «Конфигурация TR» (данные ответов, подставляемые в TERMINAL RESPONSE для проактивных команд).

-

Меню STK

+

6.1 Меню STK

Если карта выдала команду SET UP MENU, вверху этого представления появляется блок «Меню STK» с изумрудной кнопкой STK: <название>, открывающей оверлей меню (браузер STK-меню карты). Если карта не задала меню, вместо кнопки показывается «Меню не задано картой». Состояние меню обновляется при каждом открытии представления. Интерактивные проактивные команды всегда получают TERMINAL RESPONSE: оверлей ждёт вашего выбора, и если вы не ответили и не нажали Timeout, сервер сам отвечает результатом timeout через --menu-timeout секунд (по умолчанию 60, 0 отключает).

6.2 Подписанные события (SET UP EVENT LIST)

@@ -426,7 +426,10 @@

6.3 Журнал проактивных команд

Хронологический список извлечённых проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор (для команд, у которых он есть). Для команд с данными ответа показывается строка Ответ: с байтами TERMINAL RESPONSE (без служебных TLV); ответы PROVIDE LOCAL INFORMATION декодируются через словарь данных PLI.

-

6.4 Словарь данных PROVIDE LOCAL INFORMATION

+

6.4 Опрос STATUS

+

Кнопка Отправить STATUS отправляет STATUS (F2) вручную. Переключатель Опрос включает фоновый опрос: после настраиваемого интервала бездействия (аргумент сервера --poll-interval, 1–255 с, по умолчанию 30 с, 0 отключает опрос) сервер отправляет STATUS и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.

+ +

6.5 «Конфигурация TR» — данные ответа PROVIDE LOCAL INFORMATION

Редактируемые hex-значения для всех 22 квалификаторов PLI (TS 102 223 §8.6 + TS 131 111). У десяти квалификаторов есть встроенные формы декодирования/кодирования:

Значения хранятся на сервере до перезапуска. Когда карта выдаёт PLI, сервер вставляет значения словаря в TERMINAL RESPONSE.

-

6.5 Опрос STATUS

-

Кнопка Отправить STATUS отправляет STATUS (F2) вручную. Переключатель Опрос включает фоновый опрос: после настраиваемого интервала бездействия (аргумент сервера --poll-interval, 1–255 с, по умолчанию 30 с, 0 отключает опрос) сервер отправляет STATUS и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.

-
diff --git a/frontend/help.html b/frontend/help.html index 8ccd842..c0bfee5 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -408,9 +408,9 @@

6. Phone simulator

-

Interacts with the Card Application Toolkit session: the STK menu, subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

+

Interacts with the Card Application Toolkit session. The view has two pills: Phone (STK menu, STATUS and polling, subscribed events, proactive command log) and TR Config (response data injected into TERMINAL RESPONSEs for proactive commands).

-

STK menu

+

6.1 STK menu

When the card has issued a SET UP MENU command, a “STK menu” block appears at the top of this view with an emerald STK: <title> button that opens the menu overlay (same as the card’s STK menu browser). If the card has not set up a menu, the block shows “No menu set by the card” instead. The menu state is refreshed each time the view is opened. User-interactive proactive commands always get a TERMINAL RESPONSE: the overlay pauses for your choice, and if you neither answer nor press Timeout, the server answers with a timeout result after the --menu-timeout seconds (default 60, 0 disables).

6.2 Subscribed events (SET UP EVENT LIST)

@@ -426,7 +426,10 @@

6.3 Proactive command log

Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.

-

6.4 PROVIDE LOCAL INFORMATION data dictionary

+

6.4 STATUS polling

+

A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

+ +

6.5 TR Config — PROVIDE LOCAL INFORMATION response data

Editable hex values for all 22 PLI qualifiers (TS 102 223 §8.6 + TS 131 111). Ten qualifiers have inline decode/encode forms:

  • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
  • @@ -436,9 +439,6 @@

Values persist server-side until restart. When the card issues PLI, the server injects the dictionary values into the TERMINAL RESPONSE.

-

6.5 STATUS polling

-

A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

-
diff --git a/frontend/index.html b/frontend/index.html index 69102f1..e333e94 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -897,37 +897,47 @@