1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/static/js/console_window.js
catborise 946629b035 refactor(instances): the VM lists' scripts load from static files
The VM lists lose their inline scripts and handlers: host_groups.js
collapses a host's VMs in the grouped list, new_vm_dialog.js reads the
new-VM dialog's CPU bars and capacity lines, and console_window.js
(loaded by every page) opens a console button's window, on the lists and
on the VM page alike. A list row's Start no longer calls the please-wait
dialog, which the list pages do not have (the call only raised an
error). The VM page's URL placeholders take the __name__ form the other
pages use.
2026-11-02 09:35:07 +03:00

6 lines
341 B
JavaScript

// A console button (data-url, data-window) opens the console in one window
// per VM: opening it again reloads that window.
document.addEventListener("click", function (event) {
var button = event.target.closest("button[data-window]");
if (button) window.open(button.dataset.url, button.dataset.window, "width=850,height=650");
});