// history.js — история тестов let historyOpen=false; async function toggleHistory(){ const body=document.getElementById('history-body'); historyOpen=!historyOpen; body.style.display=historyOpen?'block':'none'; if(historyOpen) await loadHistory(); } async function loadHistory(){ const body=document.getElementById('history-body'); if(!body||body.style.display==='none') return; try{ const r=await fetch('/api/history'); const rows=await r.json(); if(!rows||!rows.length){body.innerHTML='Нет записей'; return;} let html='
| Время | Операция | Инстанс | Статус | Длит. |
|---|---|---|---|---|
| ${time} | ${_esc(r.op_name||'?')} | ${_esc(r.display_name||r.instance_uid||'?')} | ${_esc(r.status||'?')} | ${r.duration_sec!=null?r.duration_sec.toFixed(1)+'s':'-'} |