1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00

feat(tables): tables sort with tablesort, the grouped VM list within each host

sortable.js 0.8.0 (abandoned since 2014) sorted only a table's first
body: in the grouped VM list the first host's row moved among its VMs
and the other hosts never sorted, and memory sorted as text ("1024 MB"
before "512 MB"). tablesort 5.7.1 sorts each table body on its own and
keeps a row marked data-sort-method="none" in place, so hosts stay in
name order with their row on top and their VMs sort below it. Memory,
vCPUs and volume sizes sort by their numbers (data-sort). Headers are
reachable by keyboard and carry aria-sort.

base.html loads tablesort for every table marked data-sortable; the
per-page sortable includes and sortable-theme-bootstrap.css go, so these
tables take the theme's table style like the others. The grouped list's
row numbers go (meaningless once sorted). The VM owners and VM logs
tables were marked sortable but never loaded the script; they stay
unsorted.
This commit is contained in:
catborise 2026-10-24 18:15:04 +03:00
parent ee72e36ad1
commit 7cf12b997b
20 changed files with 84 additions and 180 deletions

View file

@ -53,6 +53,27 @@ body {
height: 350px;
}
/* headers of sortable tables (static/js/sort_tables.js): the sorted one shows
its direction, up for ascending */
th[role=columnheader]:not([data-sort-method="none"]) {
cursor: pointer;
user-select: none;
}
th[aria-sort]:not([data-sort-method="none"])::after {
content: "";
display: inline-block;
margin-left: 0.4em;
vertical-align: middle;
border: 0.3em solid transparent;
border-top-color: currentColor;
}
th[aria-sort="ascending"]:not([data-sort-method="none"])::after {
border-top-color: transparent;
border-bottom-color: currentColor;
}
.host-collapsed tr[host] {
display: none;
}