Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
2c10fda3
Commit
2c10fda3
authored
Aug 20, 2023
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make it obvious that a config_status is corrupted
also format HTML removing unnecessary text blocks
parent
7ca20adc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
107 deletions
+117
-107
modules/ui_extensions.py
modules/ui_extensions.py
+117
-107
No files found.
modules/ui_extensions.py
View file @
2c10fda3
...
@@ -200,8 +200,7 @@ def update_config_states_table(state_name):
...
@@ -200,8 +200,7 @@ def update_config_states_table(state_name):
created_date
=
time
.
asctime
(
time
.
gmtime
(
config_state
[
"created_at"
]))
created_date
=
time
.
asctime
(
time
.
gmtime
(
config_state
[
"created_at"
]))
filepath
=
config_state
.
get
(
"filepath"
,
"<unknown>"
)
filepath
=
config_state
.
get
(
"filepath"
,
"<unknown>"
)
code
=
f
"""<!-- {time.time()} -->"""
try
:
webui_remote
=
config_state
[
"webui"
][
"remote"
]
or
""
webui_remote
=
config_state
[
"webui"
][
"remote"
]
or
""
webui_branch
=
config_state
[
"webui"
][
"branch"
]
webui_branch
=
config_state
[
"webui"
][
"branch"
]
webui_commit_hash
=
config_state
[
"webui"
][
"commit_hash"
]
or
"<unknown>"
webui_commit_hash
=
config_state
[
"webui"
][
"commit_hash"
]
or
"<unknown>"
...
@@ -227,12 +226,12 @@ def update_config_states_table(state_name):
...
@@ -227,12 +226,12 @@ def update_config_states_table(state_name):
if
current_webui
[
"commit_hash"
]
!=
webui_commit_hash
:
if
current_webui
[
"commit_hash"
]
!=
webui_commit_hash
:
style_commit
=
STYLE_PRIMARY
style_commit
=
STYLE_PRIMARY
code
+=
f
"""<h2>Config Backup: {config_name}</h2
>
code
=
f
"""<!-- {time.time()} --
>
<div><b>Filepath:</b> {filepath}</div
>
<h2>Config Backup: {config_name}</h2
>
<div><b>Created at:</b> {created_date}</div>"""
<div><b>Filepath:</b> {filepath}</div>
<div><b>Created at:</b> {created_date}</div>
code
+=
f
"""
<h2>WebUI State</h2>
<h2>WebUI State</h2>
<table id="config_state_webui">
<table id="config_state_webui">
<thead>
<thead>
<tr>
<tr>
<th>URL</th>
<th>URL</th>
...
@@ -243,17 +242,23 @@ def update_config_states_table(state_name):
...
@@ -243,17 +242,23 @@ def update_config_states_table(state_name):
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr>
<td><label{style_remote}>{remote}</label></td>
<td>
<td><label{style_branch}>{webui_branch}</label></td>
<label{style_remote}>{remote}</label>
<td><label{style_commit}>{commit_link}</label></td>
</td>
<td><label{style_commit}>{date_link}</label></td>
<td>
<label{style_branch}>{webui_branch}</label>
</td>
<td>
<label{style_commit}>{commit_link}</label>
</td>
<td>
<label{style_commit}>{date_link}</label>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
"""
<h2>Extension State</h2>
<table id="config_state_extensions">
code
+=
"""<h2>Extension State</h2>
<table id="config_state_extensions">
<thead>
<thead>
<tr>
<tr>
<th>Extension</th>
<th>Extension</th>
...
@@ -264,7 +269,7 @@ def update_config_states_table(state_name):
...
@@ -264,7 +269,7 @@ def update_config_states_table(state_name):
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
"""
"""
ext_map
=
{
ext
.
name
:
ext
for
ext
in
extensions
.
extensions
}
ext_map
=
{
ext
.
name
:
ext
for
ext
in
extensions
.
extensions
}
...
@@ -299,20 +304,25 @@ def update_config_states_table(state_name):
...
@@ -299,20 +304,25 @@ def update_config_states_table(state_name):
if
current_ext
.
commit_hash
!=
ext_commit_hash
:
if
current_ext
.
commit_hash
!=
ext_commit_hash
:
style_commit
=
STYLE_PRIMARY
style_commit
=
STYLE_PRIMARY
code
+=
f
"""
code
+=
f
""" <tr>
<tr>
<td><label{style_enabled}><input class="gr-check-radio gr-checkbox" type="checkbox" disabled="true" {'checked="checked"' if ext_enabled else ''}>{html.escape(ext_name)}</label></td>
<td><label{style_enabled}><input class="gr-check-radio gr-checkbox" type="checkbox" disabled="true" {'checked="checked"' if ext_enabled else ''}>{html.escape(ext_name)}</label></td>
<td><label{style_remote}>{remote}</label></td>
<td><label{style_remote}>{remote}</label></td>
<td><label{style_branch}>{ext_branch}</label></td>
<td><label{style_branch}>{ext_branch}</label></td>
<td><label{style_commit}>{commit_link}</label></td>
<td><label{style_commit}>{commit_link}</label></td>
<td><label{style_commit}>{date_link}</label></td>
<td><label{style_commit}>{date_link}</label></td>
</tr>
</tr>
"""
"""
code
+=
"""
code
+=
""" </tbody>
</tbody>
</table>"""
</table>
"""
except
Exception
as
e
:
print
(
f
"[ERROR]: Config states {filepath}, {e}"
)
code
=
f
"""<!-- {time.time()} -->
<h2>Config Backup: {config_name}</h2>
<div><b>Filepath:</b> {filepath}</div>
<div><b>Created at:</b> {created_date}</div>
<h2>This file is corrupted</h2>"""
return
code
return
code
...
...
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