Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
f8feeaae
Commit
f8feeaae
authored
Jan 28, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add progressbar to extension update check; do not check for updates for disabled extensions
parent
d04e3e92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
extensions.js
javascript/extensions.js
+17
-3
ui_extensions.py
modules/ui_extensions.py
+18
-10
No files found.
javascript/extensions.js
View file @
f8feeaae
function
extensions_apply
(
_
,
_
){
disable
=
[]
update
=
[]
var
disable
=
[]
var
update
=
[]
gradioApp
().
querySelectorAll
(
'#extensions input[type="checkbox"]'
).
forEach
(
function
(
x
){
if
(
x
.
name
.
startsWith
(
"enable_"
)
&&
!
x
.
checked
)
disable
.
push
(
x
.
name
.
substr
(
7
))
...
...
@@ -16,11 +17,24 @@ function extensions_apply(_, _){
}
function
extensions_check
(){
var
disable
=
[]
gradioApp
().
querySelectorAll
(
'#extensions input[type="checkbox"]'
).
forEach
(
function
(
x
){
if
(
x
.
name
.
startsWith
(
"enable_"
)
&&
!
x
.
checked
)
disable
.
push
(
x
.
name
.
substr
(
7
))
})
gradioApp
().
querySelectorAll
(
'#extensions .extension_status'
).
forEach
(
function
(
x
){
x
.
innerHTML
=
"Loading..."
})
return
[]
var
id
=
randomId
()
requestProgress
(
id
,
gradioApp
().
getElementById
(
'extensions_installed_top'
),
null
,
function
(){
})
return
[
id
,
JSON
.
stringify
(
disable
)]
}
function
install_extension_from_index
(
button
,
url
){
...
...
modules/ui_extensions.py
View file @
f8feeaae
...
...
@@ -13,7 +13,7 @@ import shutil
import
errno
from
modules
import
extensions
,
shared
,
paths
from
modules.call_queue
import
wrap_gradio_gpu_call
available_extensions
=
{
"extensions"
:
[]}
...
...
@@ -50,12 +50,17 @@ def apply_and_restart(disable_list, update_list):
shared
.
state
.
need_restart
=
True
def
check_updates
():
def
check_updates
(
id_task
,
disable_list
):
check_access
()
for
ext
in
extensions
.
extensions
:
if
ext
.
remote
is
None
:
continue
disabled
=
json
.
loads
(
disable_list
)
assert
type
(
disabled
)
==
list
,
f
"wrong disable_list data for apply_and_restart: {disable_list}"
exts
=
[
ext
for
ext
in
extensions
.
extensions
if
ext
.
remote
is
not
None
and
ext
.
name
not
in
disabled
]
shared
.
state
.
job_count
=
len
(
exts
)
for
ext
in
exts
:
shared
.
state
.
textinfo
=
ext
.
name
try
:
ext
.
check_updates
()
...
...
@@ -63,7 +68,9 @@ def check_updates():
print
(
f
"Error checking updates for {ext.name}:"
,
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
return
extension_table
()
shared
.
state
.
nextjob
()
return
extension_table
(),
""
def
extension_table
():
...
...
@@ -273,12 +280,13 @@ def create_ui():
with
gr
.
Tabs
(
elem_id
=
"tabs_extensions"
)
as
tabs
:
with
gr
.
TabItem
(
"Installed"
):
with
gr
.
Row
():
with
gr
.
Row
(
elem_id
=
"extensions_installed_top"
):
apply
=
gr
.
Button
(
value
=
"Apply and restart UI"
,
variant
=
"primary"
)
check
=
gr
.
Button
(
value
=
"Check for updates"
)
extensions_disabled_list
=
gr
.
Text
(
elem_id
=
"extensions_disabled_list"
,
visible
=
False
)
.
style
(
container
=
False
)
extensions_update_list
=
gr
.
Text
(
elem_id
=
"extensions_update_list"
,
visible
=
False
)
.
style
(
container
=
False
)
info
=
gr
.
HTML
()
extensions_table
=
gr
.
HTML
(
lambda
:
extension_table
())
apply
.
click
(
...
...
@@ -289,10 +297,10 @@ def create_ui():
)
check
.
click
(
fn
=
check_updates
,
fn
=
wrap_gradio_gpu_call
(
check_updates
,
extra_outputs
=
[
gr
.
update
()])
,
_js
=
"extensions_check"
,
inputs
=
[],
outputs
=
[
extensions_table
],
inputs
=
[
info
,
extensions_disabled_list
],
outputs
=
[
extensions_table
,
info
],
)
with
gr
.
TabItem
(
"Available"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment