v3.23.9: the CAP compatibility test suggestion on a failed install
A RAM install that fails at a LOAD step is typically the library-version gate: the card verifies the CAP's import list when the Import component completes (JC VM 4.5.2). The failure hint now says so and points at the CAP compatibility test (Set all 0.0, then restore the lines one at a time to find the missing package and version), replacing the old "retry with a smaller LOAD block" advice, which is a red herring for that gate. The failure popup gains a one-click "Run the CAP compatibility test" button: it closes the popup, switches the RAM operation selector to compat and runs it with the same .cap (the file input still holds it and the probe list is prefilled with its imports), so the diagnostic is one click away. An INSTALL [for load] refusal now gets its own advice instead of the LOAD hint: the card refused to open the load file - usually a duplicate load file from an earlier run (delete the package first, Explore -> Delete), or rejected load parameters. Tests: the hint's wording and branches (LOAD vs INSTALL [for load]), the button handler's op switch. 862 frontend + 842 Python; sw cache simple-v422.
This commit is contained in:
+37
-4
@@ -1905,7 +1905,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 = '3.23.8';
|
||||
const SIMPLE_VERSION = '3.23.9';
|
||||
document.getElementById('app-version').textContent = 'v' + SIMPLE_VERSION;
|
||||
|
||||
// ===== view history (the browser Back/Forward buttons) =====
|
||||
@@ -12065,13 +12065,21 @@ function ramInstallFailHint(data, mem) {
|
||||
const steps = data.steps || [];
|
||||
const step = steps[(Number(data.failed_step) || 1) - 1] || null;
|
||||
const name = step ? String(step.name || '') : '';
|
||||
if (!/^(LOAD |INSTALL \[for load\])/.test(name)) return '';
|
||||
if (name === 'INSTALL [for load]') {
|
||||
// the card refused to open the load file: usually the package is
|
||||
// already on the card (a duplicate load-file AID from an earlier
|
||||
// run), or it rejected the load parameters
|
||||
return t('the card refused to open the load file. If this package is already installed (an earlier run), delete it first (Explore \u2192 Delete) and retry; otherwise check the install parameters.');
|
||||
}
|
||||
if (!/^LOAD /.test(name)) return '';
|
||||
// the LOAD gate: the card verifies the CAP's import list while it reads
|
||||
// the Import component, so a library-version mismatch is the typical
|
||||
// cause - point at the compatibility test that finds the exact one
|
||||
let hint = '';
|
||||
const sc = ramStepComponents(name, mem && mem.components, data.load_block_size);
|
||||
if (sc && sc.completed.length) hint += t('the failed step completes') + ' ' + sc.completed[sc.completed.length - 1] + '. ';
|
||||
hint += t('a LOAD rejected here means the card refused the CAP: every import version under Requires must be present on the card');
|
||||
hint += t('a LOAD rejected here means the card refused the CAP\'s libraries: run the CAP compatibility test - it checks this CAP\'s import list against the card (Set all 0.0, then restore the lines one at a time to find the missing package and version)');
|
||||
if (mem && mem.requires_java_card) hint += ' (Java Card \u2265 ' + mem.requires_java_card + ')';
|
||||
hint += t('. If the CAP needs only versions this card has, retry with a smaller LOAD block (e.g. 64 B)');
|
||||
return hint;
|
||||
}
|
||||
|
||||
@@ -12951,6 +12959,16 @@ function ramShowInstallResult(data, okText, capMem) {
|
||||
// successful run and for failures that are not LOAD/INSTALL [for load]).
|
||||
let modal = esc(txt);
|
||||
modal += ramCompatDetailHtml(data, capMem || null);
|
||||
// a failed LOAD is typically the library gate: offer the one-click
|
||||
// compatibility test with the same CAP (the file input still holds it,
|
||||
// the probe list is prefilled with its imports)
|
||||
if (!data.success) {
|
||||
const fStep = (data.steps || [])[(Number(data.failed_step) || 1) - 1] || null;
|
||||
if (fStep && /^LOAD /.test(String(fStep.name || ''))) {
|
||||
modal += '<div class="mt-3"><button type="button" onclick="ramRunCompatTest()" class="px-3 py-1.5 text-xs font-medium rounded bg-amber-600 text-white hover:bg-amber-700">'
|
||||
+ esc(t('Run the CAP compatibility test')) + '</button></div>';
|
||||
}
|
||||
}
|
||||
// low counter: not recoverable by retrying - state it and offer the
|
||||
// bounded sync probe or the preset jump (v3.6.58)
|
||||
if (spCntrLow(data)) {
|
||||
@@ -12961,6 +12979,18 @@ function ramShowInstallResult(data, okText, capMem) {
|
||||
ramOpModalFinish(resultEl.textContent, !!data.success, modal, true);
|
||||
}
|
||||
|
||||
// One-click diagnostic from a failed install: close the modal, switch the RAM
|
||||
// operation to the compatibility test (the CAP file input still holds the
|
||||
// same file and the probe list is prefilled with its imports) and run it.
|
||||
function ramRunCompatTest() {
|
||||
const sel = document.getElementById('ram-op');
|
||||
if (!sel) return;
|
||||
ramOpModalClose();
|
||||
sel.value = 'compat';
|
||||
ramOpChanged();
|
||||
ramExecute();
|
||||
}
|
||||
|
||||
async function ramExecute() {
|
||||
const op = document.getElementById('ram-op').value;
|
||||
if (op === 'install-cap' && !capGateOk('ram')) {
|
||||
@@ -23159,6 +23189,9 @@ const LANG_RU = {
|
||||
'text': 'текст',
|
||||
'relevant for': 'подходит для',
|
||||
'all other results': 'остальные результаты',
|
||||
'Run the CAP compatibility test': 'Запустить тест совместимости CAP',
|
||||
'the card refused to open the load file. If this package is already installed (an earlier run), delete it first (Explore \u2192 Delete) and retry; otherwise check the install parameters.': 'карта отказалась открыть load-файл. Если этот пакет уже установлен (прошлый запуск), сначала удалите его (Explore \u2192 Удалить) и повторите; иначе проверьте параметры установки.',
|
||||
'a LOAD rejected here means the card refused the CAP\'s libraries: run the CAP compatibility test - it checks this CAP\'s import list against the card (Set all 0.0, then restore the lines one at a time to find the missing package and version)': 'LOAD отклонён — карта не поддерживает библиотеки CAP: запустите тест совместимости CAP — он проверяет список импорта CAP по карте (сначала «Set all 0.0», затем возвращайте строки по одной, чтобы найти отсутствующий пакет и версию)',
|
||||
'TERMINAL PROFILE re-sent \u2014 new CAT session': 'TERMINAL PROFILE отправлен заново \u2014 новая CAT-сессия',
|
||||
'manual input': 'ручной ввод',
|
||||
'Additional information (optional hex byte)': 'Дополнительная информация (необязательный hex-байт)',
|
||||
|
||||
Reference in New Issue
Block a user