Proactive log: inline TR hex, remove expand toggle + polling re-render

This commit is contained in:
2026-08-11 23:05:34 +03:00
parent 7c5d0051d4
commit 3b7dbf1743
+2 -24
View File
@@ -3966,12 +3966,6 @@ function pysimStartBackendPoll() {
pysimFetch('/api/stk-status'), pysimFetch('/api/stk-status'),
pysimFetch('/api/poll-status'), pysimFetch('/api/poll-status'),
]); ]);
const elLog = document.getElementById('pysim-proactive-log');
const visible = elLog && elLog.parentElement && !elLog.parentElement.closest('.hidden');
if (visible) {
pysimProactiveLogRender();
pysimEventsRender();
}
pysimUpdatePollUI(ps.enabled, ps.interval); pysimUpdatePollUI(ps.enabled, ps.interval);
if (Array.isArray(log) && log.length > 0) _hadData = true; if (Array.isArray(log) && log.length > 0) _hadData = true;
if (_hadData && !ps.enabled && Array.isArray(log) && log.length === 0) { if (_hadData && !ps.enabled && Array.isArray(log) && log.length === 0) {
@@ -4021,15 +4015,12 @@ async function pysimProactiveLogRender() {
if (qs) qual = ' [' + (qs[parseInt(e.qualifier,16)] || '0x'+e.qualifier.toUpperCase()) + ']'; if (qs) qual = ' [' + (qs[parseInt(e.qualifier,16)] || '0x'+e.qualifier.toUpperCase()) + ']';
else qual = ' [0x' + e.qualifier.toUpperCase() + ']'; else qual = ' [0x' + e.qualifier.toUpperCase() + ']';
} }
html += '<div data-plog-row="' + i + '">' html += '<div class="flex items-center gap-2 py-0.5">'
+ '<div class="flex items-center gap-2 py-0.5">'
+ (e.tr_hex ? '<span class="cursor-pointer select-none text-gray-400 hover:text-gray-600 dark:hover:text-gray-300" onclick="pysimPlogToggle(' + i + ')" id="plog-tog-' + i + '">▶</span>' : '<span class="w-3"></span>')
+ '<span class="w-12 text-right text-gray-400">' + e.elapsed + 's</span>' + '<span class="w-12 text-right text-gray-400">' + e.elapsed + 's</span>'
+ '<span class="font-mono text-gray-400">0x' + e.type_hex.toUpperCase() + '</span>' + '<span class="font-mono text-gray-400">0x' + e.type_hex.toUpperCase() + '</span>'
+ '<span class="truncate">' + esc(name) + '</span>' + '<span class="truncate">' + esc(name) + '</span>'
+ (qual ? '<span class="text-[10px] text-gray-500 dark:text-slate-400">' + esc(qual) + '</span>' : '') + (qual ? '<span class="text-[10px] text-gray-500 dark:text-slate-400">' + esc(qual) + '</span>' : '')
+ '</div>' + (e.tr_hex ? '<span class="font-mono text-[10px] text-gray-400 dark:text-slate-500">' + esc(e.tr_hex) + '</span>' : '')
+ (e.tr_hex ? '<div class="pli-decode-panel hidden ml-4 pl-2 border-l border-gray-300 dark:border-slate-600" data-plog-data="' + i + '"><div class="text-[10px] font-mono text-gray-500 dark:text-slate-400 max-h-20 overflow-auto whitespace-pre-wrap">Response: ' + esc(e.tr_hex) + '\nSW: ' + esc(e.tr_sw) + '</div></div>' : '')
+ '</div>'; + '</div>';
}); });
el.innerHTML = html; el.innerHTML = html;
@@ -4038,19 +4029,6 @@ async function pysimProactiveLogRender() {
} }
} }
function pysimPlogToggle(idx) {
const panel = document.querySelector('[data-plog-data="' + idx + '"]');
const tog = document.getElementById('plog-tog-' + idx);
if (!panel || !tog) return;
if (panel.classList.contains('hidden')) {
panel.classList.remove('hidden');
tog.textContent = '▼';
} else {
panel.classList.add('hidden');
tog.textContent = '▶';
}
}
// ===== PLI data dictionary ===== // ===== PLI data dictionary =====
function decPlmn(hex3) { function decPlmn(hex3) {
const h = hex3.replace(/\s/g, '').slice(0, 6); const h = hex3.replace(/\s/g, '').slice(0, 6);