cards: per-target TARs (ISD/UICC/USIM) and an ADM field in presets (v2.6.0)

- the SCP80 fieldset gains ISD TAR (000000), UICC TAR (B00000) and USIM TAR
  (B00001), prefilled with the spec defaults; empty stored values mean the
  default for that target (cardsTarValue)
- ADM field between "From card" and "Add", stored in the preset for later
  use by the file manager (placeholder ADM (optional), spaces stripped)
- packing a chain selects the preset TAR for its target: RAM/GP -> ISD,
  SIM RFM -> UICC, USIM RFM -> USIM (spec default without a preset);
  _spTarKey keeps the target when the card preset is picked afterwards,
  RAM card selection forces the ISD TAR
- USIM RFM 'from current DF' labelled (ADF.USIM); the list TAR column shows
  all three values; help EN/RU updated
- SW cache simple-v199; new cards_form.test.js + html markup guards
  (440 frontend / 281 Python tests green)
This commit is contained in:
2026-09-20 00:05:39 +03:00
parent 8aa9e8eaef
commit 15121cff20
8 changed files with 357 additions and 25 deletions
+14
View File
@@ -33,6 +33,9 @@ test('the card form groups the SCP80 and SCP81 fields into labelled fieldsets',
assert.ok(scp81, 'SCP81 card fieldset not found');
assert.match(scp80, /id="cards-kic"/);
assert.match(scp80, /id="cards-kid-key"/);
assert.match(scp80, /id="cards-tar"[^>]*value="000000"/);
assert.match(scp80, /id="cards-uicc-tar"[^>]*value="B00000"/);
assert.match(scp80, /id="cards-usim-tar"[^>]*value="B00001"/);
assert.match(scp81, /id="cards-psk-id"/);
assert.match(scp81, /id="cards-psk-key"/);
// the PSK explanation lives inside the SCP81 group, not outside it
@@ -41,6 +44,17 @@ test('the card form groups the SCP80 and SCP81 fields into labelled fieldsets',
assert.ok(!fieldsets.some(f => f.includes('id="cards-iccid"')));
});
test('the ADM field sits between From card and Add, outside the card fieldsets', () => {
const fieldsets = [...html.matchAll(/<fieldset[\s\S]*?<\/fieldset>/g)].map(m => m[0]);
assert.ok(!fieldsets.some(f => f.includes('id="cards-adm"')));
assert.match(html, /id="cards-adm"[^>]*placeholder="ADM \(optional\)"/);
const fromIdx = html.indexOf('id="cards-iccid-from-card"');
const admIdx = html.indexOf('id="cards-adm"');
const addIdx = html.indexOf('id="cards-add-btn"');
assert.ok(fromIdx >= 0 && fromIdx < admIdx && admIdx < addIdx,
'ADM input must sit between the From card and Add buttons');
});
test('labelled containers use fieldsets with embedded legends', () => {
const legendCls = '<legend class="px-1 text-xs font-medium text-gray-500 dark:text-slate-400"';
for (const label of ['STK menu', 'STATUS and Polling', 'TERMINAL PROFILE',