fix for annoying infinite gradio spinner in status tab
parent
e4390723e1
commit
75806e8a18
|
|
@ -3,21 +3,15 @@ function confirm_restart_workers(_) {
|
|||
return confirm('Restart remote workers?')
|
||||
}
|
||||
|
||||
// live updates
|
||||
// live updates for extension status tab
|
||||
function update() {
|
||||
try {
|
||||
let currentTab = get_uiCurrentTabContent()
|
||||
let buttons = document.querySelectorAll('#distributed-refresh-status')
|
||||
for(let i = 0; i < buttons.length; i++) {
|
||||
if(currentTab.contains(buttons[i])) {
|
||||
buttons[i].click()
|
||||
break
|
||||
}
|
||||
}
|
||||
get_uiCurrentTabContent().querySelectorAll('#distributed-refresh-status')[0].click()
|
||||
} catch (e) {
|
||||
if (!(e instanceof TypeError)) {
|
||||
throw e
|
||||
}
|
||||
console.log('distributed ext: sdwui page not yet loaded... waiting')
|
||||
}
|
||||
}
|
||||
setInterval(update, 1500)
|
||||
|
|
@ -247,7 +247,7 @@ class UI:
|
|||
)
|
||||
|
||||
refresh_status_btn = gradio.Button(value='Refresh 🔄', size='sm', elem_id='distributed-refresh-status', visible=False)
|
||||
refresh_status_btn.click(self.status_btn, inputs=[], outputs=[jobs, status, logs], show_progress=False)
|
||||
refresh_status_btn.click(self.status_btn, inputs=[], outputs=[jobs, status, logs], show_progress='hidden', queue=False)
|
||||
|
||||
status_tab.select(fn=self.status_btn, inputs=[], outputs=[jobs, status, logs])
|
||||
components += [status, jobs, logs, refresh_status_btn]
|
||||
|
|
|
|||
Loading…
Reference in New Issue