diff options
author | Martín (Netux) Rodríguez <send.email@netux.site> | 2023-06-25 03:30:08 +0000 |
---|---|---|
committer | Martín (Netux) Rodríguez <send.email@netux.site> | 2023-06-25 03:48:46 +0000 |
commit | dd268c48c9099c4cf308eb04590bd201c9b64253 (patch) | |
tree | 499712c01d854defc5368d05cecf9f114cb5aa1a /modules/ui_extensions.py | |
parent | 59419bd64a1581caccaac04dceb66c1c069a2db1 (diff) | |
download | stable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.tar.gz stable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.tar.bz2 stable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.zip |
feat(extensions): add toggle all checkbox to Installed tab
Small QoL addition.
While there is the option to disable all extensions with the radio buttons at the top, that only acts as an added flag and doesn't really change the state of the extensions in the UI.
An use case for this checkbox is to disable all extensions except for a few, which is important for debugging extensions.
You could do that before, but you'd have to uncheck and recheck every extension one by one.
Diffstat (limited to 'modules/ui_extensions.py')
-rw-r--r-- | modules/ui_extensions.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 4379a641..50955fab 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -138,7 +138,10 @@ def extension_table(): <table id="extensions">
<thead>
<tr>
- <th><abbr title="Use checkbox to enable the extension; it will be enabled or disabled when you click apply button">Extension</abbr></th>
+ <th>
+ <input class="gr-check-radio gr-checkbox all_extensions_toggle" type="checkbox" {'checked="checked"' if all(ext.enabled for ext in extensions.extensions) else ''} onchange="toggle_all_extensions(event)" />
+ <abbr title="Use checkbox to enable the extension; it will be enabled or disabled when you click apply button">Extension</abbr>
+ </th>
<th>URL</th>
<th>Branch</th>
<th>Version</th>
@@ -170,7 +173,7 @@ def extension_table(): code += f"""
<tr>
- <td><label{style}><input class="gr-check-radio gr-checkbox" name="enable_{html.escape(ext.name)}" type="checkbox" {'checked="checked"' if ext.enabled else ''}>{html.escape(ext.name)}</label></td>
+ <td><label{style}><input class="gr-check-radio gr-checkbox extension_toggle" name="enable_{html.escape(ext.name)}" type="checkbox" {'checked="checked"' if ext.enabled else ''} onchange="toggle_extension(event)" />{html.escape(ext.name)}</label></td>
<td>{remote}</td>
<td>{ext.branch}</td>
<td>{version_link}</td>
|