MCPcopy
hub / github.com/vladmandic/sdnext / cleanupLog

Function cleanupLog

ui/logMonitor.ts:68–81  ·  view source on GitHub ↗
(atBottom: boolean)

Source from the content-addressed store, hash-verified

66 };
67
68 const cleanupLog = (atBottom: boolean): void => {
69 if (!logMonitorEl) return;
70 while (logMonitorEl.childElementCount > 100 && logMonitorEl.firstElementChild) {
71 logMonitorEl.removeChild(logMonitorEl.firstElementChild);
72 }
73 if (atBottom) logMonitorEl.scrollTop = logMonitorEl.scrollHeight;
74 else if (logMonitorEl.parentElement) logMonitorEl.parentElement.style.cssText = 'border-bottom: 2px solid var(--highlight-color);';
75 const elWarn = document.getElementById('logWarnings');
76 const elErr = document.getElementById('logErrors');
77 const modenUIBtn = document.getElementById('btn_console');
78 if (elWarn) elWarn.innerText = String(logWarnings);
79 if (elErr) elErr.innerText = String(logErrors);
80 if (modenUIBtn) modenUIBtn.setAttribute('error-count', logErrors > 0 ? String(logErrors) : '');
81 };
82
83 const txtGallery = document.getElementById('txt2img_gallery');
84 if (txtGallery) txtGallery.style.height = window.opts.logmonitor_show ? '50vh' : '55vh';

Callers 1

logMonitorFunction · 0.85

Calls 1

StringInterface · 0.85

Tested by

no test coverage detected