mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
full ui-settings refactor
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -49,8 +49,8 @@ async function updateOpts(json_string) {
|
||||
|
||||
function showAllSettings() {
|
||||
// Try to ensure that the show all settings tab is opened by clicking on its tab button
|
||||
const tab_dirty_indicator = gradioApp().getElementById('modification_indicator_show_all_pages');
|
||||
if (tab_dirty_indicator && tab_dirty_indicator.nextSibling) tab_dirty_indicator.nextSibling.click();
|
||||
// const tab_dirty_indicator = gradioApp().getElementById('modification_indicator_show_all_pages');
|
||||
// if (tab_dirty_indicator && tab_dirty_indicator.nextSibling) tab_dirty_indicator.nextSibling.click();
|
||||
getSettingsTabs().forEach((elem) => {
|
||||
if (elem.id === 'settings_tab_licenses' || elem.id === 'settings_show_all_pages') return;
|
||||
elem.style.display = 'block';
|
||||
@@ -192,9 +192,12 @@ async function initSettings() {
|
||||
tabContentWrapper.className = 'tab-content';
|
||||
tabNavElements.parentElement.insertBefore(tabContentWrapper, tabNavElements.nextSibling);
|
||||
tabElements.forEach((elem, index) => {
|
||||
const tabName = elem.id.replace('settings_', '');
|
||||
const tabName = elem.id.replace('settings_section_tab_', '');
|
||||
const indicator = gradioApp().getElementById(`modification_indicator_${tabName}`);
|
||||
tabNavElements.insertBefore(indicator, tabNavButtons[index]);
|
||||
if (indicator) {
|
||||
tabNavElements.insertBefore(document.createElement('br'), tabNavButtons[index]);
|
||||
tabNavElements.insertBefore(indicator, tabNavButtons[index]);
|
||||
}
|
||||
tabContentWrapper.appendChild(elem);
|
||||
observer.observe(elem, { attributes: true, attributeFilter: ['style'] });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user