vm management

This commit is contained in:
Mateusz Gruszczyński
2025-10-17 16:34:25 +02:00
parent 7441e64be4
commit a47daae9ee

View File

@@ -777,7 +777,6 @@ async function renderVMAdmin() {
async function pollTask(upid, node, onUpdate, onDone) { async function pollTask(upid, node, onUpdate, onDone) {
let lastSt = null;
let lastSt = null; let lastSt = null;
if (!upid || !node) return; if (!upid || !node) return;
const started = Date.now(); const started = Date.now();
@@ -788,7 +787,9 @@ async function pollTask(upid, node, onUpdate, onDone) {
const r = await fetch('/api/task-status?upid=' + encodeURIComponent(upid) + '&node=' + encodeURIComponent(node)); const r = await fetch('/api/task-status?upid=' + encodeURIComponent(upid) + '&node=' + encodeURIComponent(node));
const d = await r.json(); const d = await r.json();
if (d && d.ok) { if (d && d.ok) {
const st = d.status || {}; lastSt = st; lastSt = st; if (onUpdate) { try { onUpdate(st); } catch { } } const st = d.status || {};
lastSt = st;
if (onUpdate) { try { onUpdate(st); } catch { } }
const s = (st.status || '').toLowerCase(); const s = (st.status || '').toLowerCase();
if (s === 'stopped' || st.exitstatus) break; if (s === 'stopped' || st.exitstatus) break;
} }