Improve device list view
build / build-linux-amd64 (push) Successful in 1m53s

This commit is contained in:
2026-05-22 23:41:55 +02:00
parent 7b6526a2e8
commit b044ab4de9
3 changed files with 27 additions and 1 deletions
+16
View File
@@ -166,6 +166,22 @@
}
});
// Plain-link confirmation prompt. HTMX has hx-confirm for its own
// requests; this is the equivalent for raw `<a href>` anchors that
// can't go through HTMX (e.g. "Connect (web client)", which opens
// a new tab and triggers a popup on the controlled machine — easy
// to fire by accident from the row action menu). Use:
//
// <a href="..." data-confirm="..." onclick="return confirmFromDataAttr(this)">
//
// The message lives in the data-attribute (only HTML-escaped, no
// JS-string escaping) which keeps the server-side renderer simple.
function confirmFromDataAttr(el) {
const msg = el && el.dataset ? el.dataset.confirm : '';
return !msg || window.confirm(msg);
}
window.confirmFromDataAttr = confirmFromDataAttr;
// Close any open per-row action popover when a click happens outside it.
// The action dropdowns are <details class="... relative"> with an
// absolutely-positioned panel; the deploy page uses <details> too but