mirror of
https://github.com/vladmandic/automatic
synced 2026-09-17 16:24:33 +02:00
handle startup errors
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -60,6 +60,10 @@ function changelogNavigate(found) {
|
||||
async function initChangelog() {
|
||||
const search = gradioApp().querySelector('#changelog_search > label> textarea');
|
||||
const md = gradioApp().getElementById('changelog_markdown');
|
||||
if (!search || !md) {
|
||||
error('initChangelog', 'Missing search or markdown elements');
|
||||
return;
|
||||
}
|
||||
const searchChangelog = async (e) => {
|
||||
if (changelogElements.length < 100) changelogElements = getAllChildren(md);
|
||||
const found = [];
|
||||
|
||||
@@ -469,6 +469,10 @@ async function initGallery() { // triggered on gradio change to monitor when ui
|
||||
el.files = gradioApp().getElementById('tab-gallery-files');
|
||||
el.status = gradioApp().getElementById('tab-gallery-status');
|
||||
el.search = gradioApp().querySelector('#tab-gallery-search textarea');
|
||||
if (!el.folders || !el.files || !el.status || !el.search) {
|
||||
error('initGallery', 'Missing gallery elements');
|
||||
return;
|
||||
}
|
||||
el.search.addEventListener('input', gallerySearch);
|
||||
el.btnSend = gradioApp().getElementById('tab-gallery-send-image');
|
||||
document.getElementById('tab-gallery-files').style.height = opts.logmonitor_show ? '75vh' : '85vh';
|
||||
|
||||
@@ -181,6 +181,10 @@ async function initSettings() {
|
||||
if (settingsInitialized) return;
|
||||
settingsInitialized = true;
|
||||
const tabNavElements = gradioApp().querySelector('#settings > .tab-nav');
|
||||
if (!tabNavElements) {
|
||||
error('initSettings', 'No tab nav elements found');
|
||||
return;
|
||||
}
|
||||
const tabNavButtons = gradioApp().querySelectorAll('#settings > .tab-nav > button');
|
||||
const tabElements = gradioApp().querySelectorAll('#settings > div:not(.tab-nav)');
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
|
||||
Reference in New Issue
Block a user