full ui-settings refactor

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-03-30 15:04:17 -04:00
parent 1137297e3a
commit a467e23d72
13 changed files with 526 additions and 519 deletions
+7 -4
View File
@@ -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'] });
});