From 8e3d191233fa6424b1b6fac32d74007cd3ae7ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sat, 18 Oct 2025 22:34:51 +0200 Subject: [PATCH] refator_comm1 --- static/js/admin.js | 18 ++++++++---------- templates/index.html | 6 +++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/static/js/admin.js b/static/js/admin.js index cd0adb9..df1197d 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -55,6 +55,11 @@ function rebuildTargetSelect(selectEl, currentNode, nodes) { if (idx >= 0) selectEl.selectedIndex = idx; } +function setMigrateDisabled(tr, disabled) { + const btn = tr.querySelector('.act-migrate'); + if (btn) btn.disabled = !!disabled; +} + export async function renderVMAdmin() { injectOnceCSS(); stopAllAdminWatches(); @@ -78,12 +83,9 @@ export async function renderVMAdmin() { const sel = ``; - const tools = `
- - -
`; - // Kolumny: SID | TYPE | NAME | NODE | ACTIONS | TARGET | TOOLS - return rowHTML([sid, type.toUpperCase(), nameCell, node, actions, sel, tools], `data-sid="${sid}"`); + const migrateBtn = ``; + // Kolumny: SID | TYPE | NAME | NODE | ACTIONS | TARGET | MIGRATE + return rowHTML([sid, type.toUpperCase(), nameCell, node, actions, sel, migrateBtn], `data-sid="${sid}"`); }); setRows(tbody, rows); @@ -155,10 +157,6 @@ export async function renderVMAdmin() { tr.querySelector('.act-shutdown')?.addEventListener('click',() => doAction('shutdown')); tr.querySelector('.act-migrate')?.addEventListener('click', () => doAction('migrate', true)); - tr.querySelector('.act-status')?.addEventListener('click', async () => { - flashDot(nameCell); - }); - ensureWatchOn(); }); diff --git a/templates/index.html b/templates/index.html index db4f3dd..5aaa883 100644 --- a/templates/index.html +++ b/templates/index.html @@ -215,7 +215,6 @@ Type Name Node - Status Actions Target Migrate @@ -223,15 +222,16 @@ - Loading… + Loading… -
Akcje: Unlock (qm), Start/Stop/Shutdown, Offline migrate.
+
Actions: Unlock (qm), Start/Stop/Shutdown, Offline migrate.
+