diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-02-19 06:52:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-19 06:52:19 +0000 |
commit | d023532c557aee024e698baa7e8b44ae63a390fb (patch) | |
tree | 142cce4d5cb060b2c9b5a4bb87b7d812e198df01 | |
parent | 15f4b217b10448449ae211df24c86a7cb0e187f4 (diff) | |
parent | 7893533674e37de258d647f22b06430e0f924bd7 (diff) | |
download | stable-diffusion-webui-gfx803-d023532c557aee024e698baa7e8b44ae63a390fb.tar.gz stable-diffusion-webui-gfx803-d023532c557aee024e698baa7e8b44ae63a390fb.tar.bz2 stable-diffusion-webui-gfx803-d023532c557aee024e698baa7e8b44ae63a390fb.zip |
Merge pull request #7798 from vladmandic/extensions
add version to extensions table
-rw-r--r-- | modules/extensions.py | 6 | ||||
-rw-r--r-- | modules/ui_extensions.py | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/modules/extensions.py b/modules/extensions.py index 5e12b1aa..1975fca1 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -2,6 +2,7 @@ import os import sys
import traceback
+import time
import git
from modules import paths, shared
@@ -25,6 +26,7 @@ class Extension: self.status = ''
self.can_update = False
self.is_builtin = is_builtin
+ self.version = ''
repo = None
try:
@@ -40,6 +42,10 @@ class Extension: try:
self.remote = next(repo.remote().urls, None)
self.status = 'unknown'
+ head = repo.head.commit
+ ts = time.asctime(time.gmtime(repo.head.commit.committed_date))
+ self.version = f'{head.hexsha[:7]} ({ts})'
+
except Exception:
self.remote = None
diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 37d30e1f..bd4308ef 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -80,6 +80,7 @@ def extension_table(): <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>URL</th>
+ <th><abbr title="Extension version">Version</abbr></th>
<th><abbr title="Use checkbox to mark the extension for update; it will be updated when you click apply button">Update</abbr></th>
</tr>
</thead>
@@ -87,11 +88,7 @@ def extension_table(): """
for ext in extensions.extensions:
- remote = ""
- if ext.is_builtin:
- remote = "built-in"
- elif ext.remote:
- remote = f"""<a href="{html.escape(ext.remote or '')}" target="_blank">{html.escape("built-in" if ext.is_builtin else ext.remote or '')}</a>"""
+ remote = f"""<a href="{html.escape(ext.remote or '')}" target="_blank">{html.escape("built-in" if ext.is_builtin else ext.remote or '')}</a>"""
if ext.can_update:
ext_status = f"""<label><input class="gr-check-radio gr-checkbox" name="update_{html.escape(ext.name)}" checked="checked" type="checkbox">{html.escape(ext.status)}</label>"""
@@ -102,6 +99,7 @@ def extension_table(): <tr>
<td><label><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{' class="extension_status"' if ext.remote is not None else ''}>{ext_status}</td>
</tr>
"""
|