1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix(ui): a host's pages on a phone: one row of sections, tables that fit

On a phone the host's section menu wrapped to three lines, each new line
starting with a divider. It is now one row that scrolls sideways, with the
current section in sight (scroll_rows.js, which also takes over the VM page's
tab rows from instance_page.js).

The filter list, a filter's rules and the PCI and USB device tables were wider
than a phone and hid their actions and users off screen; on a phone they now
keep the name, the key column and the actions, as the other lists do.

The overview's live CPU and memory figures, the chart axes and tooltips, and
the VM page's stats now write numbers as the page's language does (a decimal
comma in Turkish), like the cards beside them.

The capacity cards said "0 bytes running"; they now say what they count:
"0 bytes in running VMs".

A pool's type is written as libvirt names it on both the list and its page,
and the device search sits where the interfaces search does.
This commit is contained in:
catborise 2026-11-22 14:40:23 +03:00
parent 701d9b1f0a
commit a2da2ab394
24 changed files with 84 additions and 55 deletions

12
static/js/scroll_rows.js Normal file
View file

@ -0,0 +1,12 @@
// A row of tabs or sections that scrolls sideways on a phone (overflow-x-auto)
// keeps its current item in sight: centred in the row, the page stays put.
(function () {
function centre(item) {
var row = item.closest(".overflow-x-auto");
if (!row) return;
var box = row.getBoundingClientRect(), own = item.getBoundingClientRect();
row.scrollLeft += own.left - box.left - (box.width - own.width) / 2;
}
document.addEventListener("shown.bs.tab", function (event) { centre(event.target); });
document.querySelectorAll(".overflow-x-auto [aria-current]").forEach(centre);
})();