mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
@@ -25,8 +25,8 @@ class ConnectionMonitorState {
|
||||
static setData({ online, data }) {
|
||||
if (online !== this.online) {
|
||||
this.online = online;
|
||||
this.ts = new Date()
|
||||
debug('monitorState', { online: ConnectionMonitorState.online, ts: ConnectionMonitorState.ts })
|
||||
this.ts = new Date();
|
||||
debug('monitorState', { online: ConnectionMonitorState.online, ts: ConnectionMonitorState.ts });
|
||||
}
|
||||
if (data?.updated) this.version = data.updated;
|
||||
if (data?.commit) this.commit = data.commit;
|
||||
@@ -98,7 +98,7 @@ async function monitorConnection() {
|
||||
ConnectionMonitorState.startup = new Date();
|
||||
ConnectionMonitorState.url = res.url.split('/sdapi')[0].replace('https:', 'wss:').replace('http:', 'ws:'); // update global url as ws need fqdn
|
||||
updateIndicator(true, data);
|
||||
wsMonitorLoop(url);
|
||||
wsMonitorLoop();
|
||||
} catch {
|
||||
updateIndicator(false, data);
|
||||
setTimeout(monitorConnection, ConnectionMonitorState.delay);
|
||||
|
||||
+3
-3
@@ -601,14 +601,14 @@ function monitorServerStatus() {
|
||||
document.close();
|
||||
}
|
||||
|
||||
const delay = ms => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); // eslint-disable-line no-promise-executor-return
|
||||
|
||||
async function restartReload(initial=true) {
|
||||
async function restartReload(initial = true) {
|
||||
document.body.style = 'background: #222222; font-size: 1rem; font-family:monospace; margin-top:20%; color:lightgray; text-align:center';
|
||||
document.body.innerHTML = '<h1>Server shutdown in progress...</h1>';
|
||||
if (initial) await delay(10000);
|
||||
try {
|
||||
const res = await authFetch(`${window.api}/progress?skip_current_image=true`)
|
||||
const res = await authFetch(`${window.api}/progress?skip_current_image=true`);
|
||||
console.log('restartReload', res);
|
||||
if (res?.ok) {
|
||||
document.body.innerHTML = '<h1>Server restart in progress...</h1>';
|
||||
|
||||
Reference in New Issue
Block a user