Merge pull request #61 from Athari/fix/forge-compat

Fix compatibility with SD WebUI Forge
pull/63/head
Vladimir Mandic 2026-01-27 09:30:37 +01:00 committed by GitHub
commit bd33edfd28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 13 deletions

View File

@ -21,7 +21,7 @@ const colorRangeMap = $.range_map({
'81:90': '#7c2d12',
'91:100': '#6c2e12',
});
const sparklineConfig = { type: 'bar', height: '100px', barWidth: '3px', barSpacing: '1px', disableInteraction: true, chartRangeMin: 0, chartRangeMax: 100, disableHiddenCheck: true, colorMap: colorRangeMap, fillColor: false };
const sparklineConfig = { type: 'bar', height: '100px', barWidth: 3, barSpacing: 1, disableInteraction: true, chartRangeMin: 0, chartRangeMax: 100, disableHiddenCheck: true, colorMap: colorRangeMap, fillColor: false };
function refresh_info() {
const btn = gradioApp().getElementById('system_info_tab_refresh_btn'); // we could cache this dom element
@ -44,7 +44,7 @@ function receive_system_info(data) {
loadData.push(data?.memory?.utilization || 0);
const tab = gradioApp().getElementById('tab_system') || gradioApp().getElementById('tabs');
if (!tab) return;
sparklineConfig.barWidth = Math.floor(tab.clientWidth - 20) / data_length / 2;
sparklineConfig.barWidth = Math.max(1, Math.floor(tab.clientWidth - 20) / data_length / 2 - sparklineConfig.barSpacing);
$('#si-sparkline-load').sparkline(loadData, sparklineConfig);
if (memoData.length > data_length) memoData.shift();

View File

@ -245,17 +245,20 @@ def get_libs():
def get_repos():
repos = {}
for key, val in paths.paths.items():
try:
cmd = f'git -C {val} log --pretty=format:"%h %ad" -1 --date=short'
res = subprocess.run(f'{cmd} {val}', stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell=True, check=True)
stdout = res.stdout.decode(encoding = 'utf8', errors='ignore') if len(res.stdout) > 0 else ''
words = stdout.split(' ')
repos[key] = f'[{words[0]}] {words[1]}'
except Exception:
repos[key] = '(unknown)'
return repos
try:
repos = {}
for key, val in paths.paths.items():
try:
cmd = f'git -C {val} log --pretty=format:"%h %ad" -1 --date=short'
res = subprocess.run(f'{cmd} {val}', stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell=True, check=True)
stdout = res.stdout.decode(encoding = 'utf8', errors='ignore') if len(res.stdout) > 0 else ''
words = stdout.split(' ')
repos[key] = f'[{words[0]}] {words[1]}'
except Exception:
repos[key] = '(unknown)'
return repos
except Exception as e:
return { 'error': e }
def get_platform():