Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
1c0544ab
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
11 个月 前同步成功
通知
1767
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
1c0544ab
编写于
3月 29, 2023
作者:
S
space-nuko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add links for commits in table, if remote is from GitHub
上级
64bbd3bf
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
25 addition
and
5 deletion
+25
-5
modules/ui_extensions.py
modules/ui_extensions.py
+25
-5
未找到文件。
modules/ui_extensions.py
浏览文件 @
1c0544ab
...
...
@@ -122,6 +122,16 @@ def check_updates(id_task, disable_list):
return
extension_table
(),
""
def
make_commit_link
(
commit_hash
,
remote
,
text
=
None
):
if
text
is
None
:
text
=
commit_hash
[:
8
]
if
remote
.
startswith
(
"https://github.com/"
):
href
=
os
.
path
.
join
(
remote
,
"commit"
,
commit_hash
)
return
f
'<a href="
{
href
}
" target="_blank">
{
text
}
</a>'
else
:
return
text
def
extension_table
():
code
=
f
"""<!--
{
time
.
time
()
}
-->
<table id="extensions">
...
...
@@ -150,11 +160,15 @@ def extension_table():
if
shared
.
opts
.
disable_all_extensions
==
"extra"
and
not
ext
.
is_builtin
or
shared
.
opts
.
disable_all_extensions
==
"all"
:
style
=
STYLE_PRIMARY
version_link
=
ext
.
version
if
ext
.
commit_hash
and
ext
.
remote
:
version_link
=
make_commit_link
(
ext
.
commit_hash
,
ext
.
remote
,
ext
.
version
)
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>
{
remote
}
</td>
<td>
{
ext
.
version
}
</td>
<td>
{
version_link
}
</td>
<td
{
' class="extension_status"'
if
ext
.
remote
is
not
None
else
''
}
>
{
ext_status
}
</td>
</tr>
"""
...
...
@@ -200,6 +214,9 @@ def update_config_states_table(state_name):
if
current_webui
[
"commit_hash"
]
!=
webui_commit_hash
:
style_commit
=
STYLE_PRIMARY
commit_link
=
make_commit_link
(
webui_commit_hash
,
webui_remote
)
date_link
=
make_commit_link
(
webui_commit_hash
,
webui_remote
,
webui_commit_date
)
code
+=
f
"""<h2>Config Backup:
{
config_name
}
</h2>
<div><b>Filepath:</b>
{
filepath
}
</div>
<div><b>Created at:</b>
{
created_date
}
</div>"""
...
...
@@ -218,8 +235,8 @@ def update_config_states_table(state_name):
<tr>
<td><label
{
style_remote
}
>
{
webui_remote
}
</label></td>
<td><label
{
style_branch
}
>
{
webui_branch
}
</label></td>
<td><label
{
style_commit
}
>
{
webui_commit_hash
[:
8
]
}
</label></td>
<td><label
{
style_commit
}
>
{
webui_commit_date
}
</label></td>
<td><label
{
style_commit
}
>
{
commit_link
}
</label></td>
<td><label
{
style_commit
}
>
{
date_link
}
</label></td>
</tr>
</tbody>
</table>
...
...
@@ -270,13 +287,16 @@ def update_config_states_table(state_name):
if
current_ext
.
commit_hash
!=
ext_commit_hash
:
style_commit
=
STYLE_PRIMARY
commit_link
=
make_commit_link
(
ext_commit_hash
,
ext_remote
)
date_link
=
make_commit_link
(
ext_commit_hash
,
ext_remote
,
ext_commit_date
)
code
+=
f
"""
<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_remote
}
>
{
remote
}
</label></td>
<td><label
{
style_branch
}
>
{
ext_branch
}
</label></td>
<td><label
{
style_commit
}
>
{
ext_commit_hash
[:
8
]
}
</label></td>
<td><label
{
style_commit
}
>
{
ext_commit_date
}
</label></td>
<td><label
{
style_commit
}
>
{
commit_link
}
</label></td>
<td><label
{
style_commit
}
>
{
date_link
}
</label></td>
</tr>
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录