fix ui logging

This commit is contained in:
Vladimir Mandic
2024-05-02 10:39:30 -04:00
parent 070ae6145c
commit 6cd884acb6
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -40,9 +40,10 @@ async function logMonitor() {
else logMonitorEl.parentElement.style = 'border-bottom: 2px solid var(--highlight-color);';
document.getElementById('logWarnings').innerText = logWarnings;
document.getElementById('logErrors').innerText = logErrors;
const modenUIBtn = document.getElementById('btn_console');
if (modenUIBtn) modenUIBtn.setAttribute('error-count', logErrors);
};
// addLogLine(`{ "created": ${Date.now() / 1000}, "level":"DEBUG", "module":"ui", "facility":"logMonitor", "msg":"Log refresh" }`);
if (logMonitorStatus) setTimeout(logMonitor, opts.logmonitor_refresh_period);
else setTimeout(logMonitor, 10 * 1000); // on failure try to reconnect every 10sec
if (!opts.logmonitor_show) return;
@@ -57,7 +58,7 @@ async function logMonitor() {
if (!logMonitorEl) return;
const atBottom = logMonitorEl.scrollHeight <= (logMonitorEl.scrollTop + logMonitorEl.clientHeight);
try {
const res = await fetch('/sdapi/v1/log?clear=False');
const res = await fetch('/sdapi/v1/log?clear=True');
if (res?.ok) {
logMonitorStatus = true;
const lines = await res.json();
+1 -1
Submodule wiki updated: f4abf83594...9a9539a748