update for both tabs only when visible
parent
8ac2b3c190
commit
f5331b0bdb
|
|
@ -6,8 +6,14 @@ function confirm_restart_workers(_) {
|
||||||
// live updates
|
// live updates
|
||||||
function update() {
|
function update() {
|
||||||
try {
|
try {
|
||||||
let refresh_button = document.getElementById('distributed-refresh-status')
|
let currentTab = get_uiCurrentTabContent()
|
||||||
refresh_button.click()
|
let buttons = document.querySelectorAll('#distributed-refresh-status')
|
||||||
|
for(let i = 0; i < buttons.length; i++) {
|
||||||
|
if(currentTab.contains(buttons[i])) {
|
||||||
|
buttons[i].click()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!(e instanceof TypeError)) {
|
if (!(e instanceof TypeError)) {
|
||||||
throw e
|
throw e
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@ class World:
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"{len(self._workers)} workers"
|
return f"{len(self._workers)} workers"
|
||||||
|
|
||||||
|
|
||||||
def default_batch_size(self) -> int:
|
def default_batch_size(self) -> int:
|
||||||
"""the amount of images/total images requested that a worker would compute if conditions were perfect and
|
"""the amount of images/total images requested that a worker would compute if conditions were perfect and
|
||||||
each worker generated at the same speed. assumes one batch only"""
|
each worker generated at the same speed. assumes one batch only"""
|
||||||
|
|
@ -393,7 +392,6 @@ class World:
|
||||||
self.initialized = True
|
self.initialized = True
|
||||||
logger.debug("world initialized!")
|
logger.debug("world initialized!")
|
||||||
|
|
||||||
|
|
||||||
def get_workers(self):
|
def get_workers(self):
|
||||||
filtered: List[Worker] = []
|
filtered: List[Worker] = []
|
||||||
for worker in self._workers:
|
for worker in self._workers:
|
||||||
|
|
@ -753,7 +751,6 @@ class World:
|
||||||
for worker in self._workers:
|
for worker in self._workers:
|
||||||
worker.restart()
|
worker.restart()
|
||||||
|
|
||||||
|
|
||||||
def inject_model_dropdown_handler(self):
|
def inject_model_dropdown_handler(self):
|
||||||
if self.config().get('enabled', False): # TODO avoid access from config()
|
if self.config().get('enabled', False): # TODO avoid access from config()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue