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

fix(ui): lists say they are empty plainly, filter by themselves and fit a phone

- An empty list says so in gray text, as the VM list does, not in a
  yellow warning or a blue notice (host pools, networks, filters,
  secrets, interfaces, tags, removed VMs, backups, schedules, targets).
- The Jobs and Backups filters show only while there is something to
  filter.
- The Jobs, Backups and Logs filters apply once a choice changes or
  Enter is pressed (filter_form.js): no Filter or Search button, and
  Clear the filters only while one is set.
- On a phone the Logs table shows the date, user, VM and message, with
  the result under it, and the Computes table the host and its memory.
This commit is contained in:
catborise 2026-11-21 20:17:13 +03:00
parent 383cbe89a6
commit 70b0b42f8d
22 changed files with 79 additions and 71 deletions

15
static/js/filter_form.js Normal file
View file

@ -0,0 +1,15 @@
// A list's filter form (data-filter-form) asks the server again once a choice
// changes or Enter is pressed in a text box: it has no button of its own.
document.querySelectorAll("form[data-filter-form]").forEach(function (form) {
form.addEventListener("change", function (event) {
if (event.target.matches("select, input[type='checkbox']")) {
form.requestSubmit();
}
});
form.addEventListener("keydown", function (event) {
if (event.key === "Enter" && !event.isComposing && event.target.matches("input:not([type]), input[type='text'], input[type='search']")) {
event.preventDefault();
form.requestSubmit();
}
});
});