v1.0.78: log panel in UI + /api/log endpoint + _log() buffer
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user