From 81b50199cc0a4f30fcf00dc0e10f7bae2970cb6e 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, 20 Sep 2026 01:40:39 +0300 Subject: [PATCH] ui: bordered header badges and ICCID-labelled card actions (v2.6.2) - ADM/SCP80/SCP81 header indicators become bordered chips (neutral gray border, rounded, px-1.5 py-0.5); SCP80/SCP81 get an even ml-1 gap, so no separator glyph is needed - profiler/snapshot card actions carry the equipped card's ICCID: 'Profile from card ', 'Check card ' (row button, arrow dropped), 'New snapshot: '; pysimUpdateCardActionLabels() fills the spans on every status poll and after a language switch - these buttons switch to data-needs='card-iccid': disabled without a readable ICCID ('Card equipped but its ICCID is not readable' hint) - profiler rows wrap so the longer button cannot break the layout; help EN/RU updated; SW cache simple-v202 --- frontend/help-ru.html | 6 +++--- frontend/help.html | 6 +++--- frontend/index.html | 27 +++++++++++++++++++-------- frontend/sw.js | 2 +- frontend/tests/html.test.js | 9 +++++++++ frontend/tests/indicator.test.js | 28 ++++++++++++++++++++++++++++ pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 8 files changed, 65 insertions(+), 17 deletions(-) diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 4892389..f12193f 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -408,10 +408,10 @@

Список профилей

  • Новый профиль — создаёт пустой набор правил, запросив имя.
  • -
  • Профиль с карты — сканирует подключённую карту и создаёт по одному правилу на каждый существующий файл (см. ниже), затем открывает редактор.
  • +
  • Профиль с карты <ICCID> — сканирует подключённую карту и создаёт по одному правилу на каждый существующий файл (см. ниже), затем открывает редактор. Кнопки, зависящие от карты, содержат ICCID подключённой карты и отключены, пока он не читается.
  • Профиль из снимка — выбирает сохранённый снимок карты и создаёт по правилу на каждый захваченный файл с теми же опциями сканирования (см. ниже), без картридера; имя профиля подставляется из имени снимка.
  • Импорт профиля — загружает набор правил из JSON-файла (имя хранится внутри JSON).
  • -
  • В каждой строке профиля показаны имя и время создания, а также действия Проверить карту ▶, Проверить снимок карты, Редактировать, Клонировать, Экспорт (скачать JSON) и Удалить. Клонировать создаёт копию профиля с именем Копия <профиль> (с суффиксом (2), (3)…, если такое имя уже занято) и открывает копию в редакторе, чтобы изменить имя и содержимое перед сохранением.
  • +
  • В каждой строке профиля показаны имя и время создания, а также действия Проверить карту <ICCID>, Проверить снимок карты, Редактировать, Клонировать, Экспорт (скачать JSON) и Удалить. Клонировать создаёт копию профиля с именем Копия <профиль> (с суффиксом (2), (3)…, если такое имя уже занято) и открывает копию в редакторе, чтобы изменить имя и содержимое перед сохранением.

Правила файловой системы

Правила выполняются последовательно. Редактор показывает символьное имя файла pySim (если известно) рядом с путём правила; Добавить правило добавляет правило, Сохранить сохраняет изменения. Правило файловой системы задаётся:

@@ -428,7 +428,7 @@

Снимки карт

Представление списка имеет две вкладки — «Профили» и «Снимки карт». Снимок карты — неизменяемая фиксация файловой системы карты: для каждого существующего файла сохраняются путь, символьное имя, тип, размер (или длина/число записей), сырой FCI из ответа SELECT и содержимое, если файл читается (без списка игнорирования и без масок). ICCID декодируется из EF.ICCID и показывается рядом с именем снимка. Захваченное содержимое показывается вместе с декодированным представлением, где есть декодер — таблица полей для transparent-файлов и однострочная сводка по каждой записи для record-файлов. При сканировании измеряется время каждой команды карты (SELECT, READ BINARY, READ RECORD) от отправки до ответа; снимок хранит min/сред/max по каждому типу команд и общее время сканирования, а в представлении эти значения показываются в сводке под заголовком, время select/read — для каждого файла и время чтения — для каждой записи. Время носит информационный характер и не используется при проверках и сравнении.

    -
  • Новый снимок — запрашивает имя и сканирует карту, затем возвращает к списку.
  • +
  • Новый снимок: <ICCID> — запрашивает имя и сканирует карту, затем возвращает к списку.
  • Импорт снимка — загружает снимок из JSON-файла.
  • В каждой строке снимка — Открыть, Экспорт и Удалить. Открыть показывает все захваченные данные только для чтения (сырой FCI с декодированным FCI, содержимое); редактируется только имя снимка.
  • Проверить снимок карты в строке профиля выполняет правила профиля на выбранном из списка снимке, без картридера. Отчёт такой же, как при проверке карты: фактическая сторона подписана именем снимка (фактически (имя снимка)), а в заголовке — Результаты проверки профиля: <профиль> → <имя снимка>; файлы, содержимое которых не было захвачено при сканировании, помечаются как непроверяемые ошибки.
  • diff --git a/frontend/help.html b/frontend/help.html index ddb67dd..d266398 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -408,10 +408,10 @@

    Profile list

    • New profile — creates an empty ruleset after prompting for a name.
    • -
    • Profile from card — scans the equipped card and generates one rule per existing file (see below), then opens the editor.
    • +
    • Profile from card <ICCID> — scans the equipped card and generates one rule per existing file (see below), then opens the editor. Card-dependent buttons carry the equipped card's ICCID and are disabled while it is not readable.
    • Profile from snapshot — picks a saved card snapshot and generates one rule per captured file using the same scan options (see below), without a card reader; the profile name is prefilled with the snapshot name.
    • Import profile — loads a ruleset from a JSON file (the name is stored inside the JSON).
    • -
    • Each profile row shows its name and creation time, with Check card ▶, Check card snapshot, Edit, Clone, Export (download JSON), and Delete actions. Clone copies the profile under the name Copy of <profile> (with a (2), (3)… suffix when that name already exists) and opens the copy in the editor, so both the name and the contents can be adjusted before saving.
    • +
    • Each profile row shows its name and creation time, with Check card <ICCID>, Check card snapshot, Edit, Clone, Export (download JSON), and Delete actions. Clone copies the profile under the name Copy of <profile> (with a (2), (3)… suffix when that name already exists) and opens the copy in the editor, so both the name and the contents can be adjusted before saving.

    Filesystem rules

    Rules run sequentially. The editor shows the symbolic pySim name (when known) next to each rule’s path; use Add rule to append one and Save to keep the changes. A filesystem rule is defined by:

    @@ -428,7 +428,7 @@

    Card snapshots

    The list view has two tabs — Profiles and Card snapshots. A card snapshot is an immutable capture of the card filesystem: for every existing file it stores the path, symbolic name, file type, size (or record length/count), the raw FCI from the SELECT response, and the contents whenever the file is readable (no ignore list, no masking). The ICCID is decoded from EF.ICCID and shown next to the snapshot name. Captured contents are shown with their decoded form where a decoder exists — a field table for transparent files and a one-line summary per record for record files. The scan also measures each card command (SELECT, READ BINARY, READ RECORD) from command to response; the snapshot stores min/avg/max per command type and the total scan time, and the view shows these in the summary under the title plus the select/read times per file and the read time per record. Timings are informational only and are not used by checks or comparisons.

      -
    • New snapshot — asks for a name and scans the card, then returns to the list.
    • +
    • New snapshot: <ICCID> — asks for a name and scans the card, then returns to the list.
    • Import snapshot — loads a snapshot from a JSON file.
    • Each snapshot row has Open, Export, and Delete. Open shows all captured data read-only (raw FCI with the decoded FCI, contents); only the snapshot name is editable.
    • Check card snapshot on a profile row runs the profile rules against a snapshot you pick from the list, without a card reader. The report is the same as a live check: the actual side is labelled with the snapshot name (actual (snapshot name)) and the header reads Profile verification results for: <profile> → <snapshot name>; files whose contents were not captured during the scan are reported as unverifiable errors.
    • diff --git a/frontend/index.html b/frontend/index.html index 5c58eee..d016f3d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -24,9 +24,9 @@ - - - + + + github @@ -722,7 +722,7 @@
      - + @@ -731,7 +731,7 @@