From fc966c029943ce37aaecd620645c770478395afc Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Mon, 8 May 2023 15:30:32 +0300 Subject: [PATCH] do not show licenses page when user selects Show all pages in settings --- javascript/ui.js | 3 +++ modules/ui.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/javascript/ui.js b/javascript/ui.js index b63b84b2..611b70d1 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -348,6 +348,9 @@ onUiUpdate(function(){ settings_tabs.appendChild(show_all_pages) show_all_pages.onclick = function(){ gradioApp().querySelectorAll('#settings > div').forEach(function(elem){ + if(elem.id == "settings_tab_licenses") + return; + elem.style.display = "block"; }) } diff --git a/modules/ui.py b/modules/ui.py index b2916e9c..39efd576 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1566,7 +1566,7 @@ def create_ui(): current_row.__exit__() current_tab.__exit__() - with gr.TabItem("Actions", id="actions"): + with gr.TabItem("Actions", id="actions", elem_id="settings_tab_actions"): request_notifications = gr.Button(value='Request browser notifications', elem_id="request_notifications") download_localization = gr.Button(value='Download localization template', elem_id="download_localization") reload_script_bodies = gr.Button(value='Reload custom script bodies (No ui updates, No restart)', variant='secondary', elem_id="settings_reload_script_bodies") @@ -1574,7 +1574,7 @@ def create_ui(): unload_sd_model = gr.Button(value='Unload SD checkpoint to free VRAM', elem_id="sett_unload_sd_model") reload_sd_model = gr.Button(value='Reload the last SD checkpoint back into VRAM', elem_id="sett_reload_sd_model") - with gr.TabItem("Licenses", id="licenses"): + with gr.TabItem("Licenses", id="licenses", elem_id="settings_tab_licenses"): gr.HTML(shared.html("licenses.html"), elem_id="licenses") gr.Button(value="Show all pages", elem_id="settings_show_all_pages")