ui quality-of-life improvements

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-02-06 16:48:31 -05:00
parent 47b484816a
commit e018ed627d
8 changed files with 30 additions and 10 deletions
+8 -4
View File
@@ -38,14 +38,18 @@ async function logMonitor() {
while (logMonitorEl.childElementCount > 100) logMonitorEl.removeChild(logMonitorEl.firstChild);
if (atBottom) logMonitorEl.scrollTop = logMonitorEl.scrollHeight;
else logMonitorEl.parentElement.style = 'border-bottom: 2px solid var(--highlight-color);';
document.getElementById('logWarnings').innerText = logWarnings;
document.getElementById('logErrors').innerText = logErrors;
const elWarn = document.getElementById('logWarnings');
const elErr = document.getElementById('logErrors');
const modenUIBtn = document.getElementById('btn_console');
if (elWarn) elWarn.innerText = logWarnings;
if (elErr) elErr.innerText = logErrors;
if (modenUIBtn) modenUIBtn.setAttribute('error-count', logErrors > 0 ? logErrors : '');
};
document.getElementById('txt2img_gallery').style.height = opts.logmonitor_show ? '50vh' : '55vh';
document.getElementById('img2img_gallery').style.height = opts.logmonitor_show ? '50vh' : '55vh';
const txtGallery = document.getElementById('txt2img_gallery');
if (txtGallery) txtGallery.style.height = opts.logmonitor_show ? '50vh' : '55vh';
const imgGallery = document.getElementById('img2img_gallery');
if (imgGallery) imgGallery.style.height = opts.logmonitor_show ? '50vh' : '55vh';
if (!opts.logmonitor_show) {
Array.from(document.getElementsByClassName('log-monitor')).forEach((el) => el.style.display = 'none');
+4 -2
View File
@@ -117,8 +117,10 @@ onAfterUiUpdate(async () => {
});
const settingsSearch = gradioApp().querySelectorAll('#settings_search > label > textarea')[0];
let settingsTimer;
settingsSearch.oninput = (e) => {
setTimeout(() => {
if (settingsTimer) clearTimeout(settingsTimer);
settingsTimer = setTimeout(() => {
log('settingsSearch', e.target.value);
showAllSettings();
getSettingsTabs().forEach((section) => {
@@ -128,7 +130,7 @@ onAfterUiUpdate(async () => {
else setting.style.removeProperty('display');
});
});
}, 50);
}, 250);
};
});