v1.0.78: log panel in UI + /api/log endpoint + _log() buffer

This commit is contained in:
2026-07-27 13:50:57 +04:00
parent 6c8d852f6c
commit 07aa2115d4
3 changed files with 46 additions and 10 deletions
+20
View File
@@ -349,6 +349,26 @@ async function refreshInstances(){
</div>`;
document.getElementById('inst-list').innerHTML=html;
}
// === Панель логов ===
let logPollTimer=null;
function startLogPoll(){
if(logPollTimer) return;
logPollTimer=setInterval(async()=>{
try{
const r=await fetch('/api/log');
const lines=await r.json();
const el=document.getElementById('log-panel');
if(!el) return;
el.innerHTML=lines.map(l=>`<div>${l}</div>`).join('');
el.scrollTop=el.scrollHeight;
}catch(e){}
},2000);
}
startLogPoll();
</script>
<div id="log-panel" style="position:fixed;bottom:0;left:0;right:0;height:180px;background:#1e1e1e;color:#d4d4d4;font:11px monospace;overflow-y:auto;padding:6px 10px;border-top:2px solid #555;z-index:9999;"></div>
</body>
</html>