mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 19:02:27 +00:00
Added sysinfo tab to settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import gradio as gr
|
||||
|
||||
from modules import ui_common, shared, script_callbacks, scripts, sd_models
|
||||
from modules import ui_common, shared, script_callbacks, scripts, sd_models, sysinfo
|
||||
from modules.call_queue import wrap_gradio_call
|
||||
from modules.shared import opts
|
||||
from modules.ui_components import FormRow
|
||||
@@ -157,6 +157,17 @@ class UiSettings:
|
||||
with gr.TabItem("Defaults", id="defaults", elem_id="settings_tab_defaults"):
|
||||
loadsave.create_ui()
|
||||
|
||||
with gr.TabItem("Sysinfo", id="sysinfo", elem_id="settings_tab_sysinfo"):
|
||||
gr.HTML('<a href="./internal/sysinfo-download" download>Download system info</a>', elem_id="sysinfo_download")
|
||||
|
||||
with gr.Row():
|
||||
with gr.Column(scale=1):
|
||||
sysinfo_check_file = gr.File(label="Check system info for validity", type='binary')
|
||||
with gr.Column(scale=1):
|
||||
sysinfo_check_output = gr.HTML("", elem_id="sysinfo_validity")
|
||||
with gr.Column(scale=100):
|
||||
pass
|
||||
|
||||
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")
|
||||
@@ -215,6 +226,21 @@ class UiSettings:
|
||||
outputs=[],
|
||||
)
|
||||
|
||||
def check_file(x):
|
||||
if x is None:
|
||||
return ''
|
||||
|
||||
if sysinfo.check(x.decode('utf8', errors='ignore')):
|
||||
return 'Valid'
|
||||
|
||||
return 'Invalid'
|
||||
|
||||
sysinfo_check_file.change(
|
||||
fn=check_file,
|
||||
inputs=[sysinfo_check_file],
|
||||
outputs=[sysinfo_check_output],
|
||||
)
|
||||
|
||||
self.interface = settings_interface
|
||||
|
||||
def add_quicksettings(self):
|
||||
|
Reference in New Issue
Block a user