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

fix(vmbackups): eighth audit: retention reads each VM once, no reload while typing

- The backups' default ordering put created_at into the SELECT DISTINCT
  of the retention pass and of the checkpoint pruning, so a VM came once
  per backup: the pass read every backup's chain again. The ordering is
  cleared before both.
- A page with a backup being made or deleted reloads every 4 s; it now
  waits while a field is focused, so a filter or the backup form being
  filled in is not lost.
This commit is contained in:
catborise 2026-11-18 15:53:18 +03:00
parent 348628f13d
commit 810abe7475
4 changed files with 10 additions and 4 deletions

View file

@ -1,12 +1,12 @@
// A backup being made or deleted: the page reads it again until it is done,
// while the backups are in view (the VM page's Backups tab, the Backups page)
// and nothing is open on them (a menu, a dialog).
// and nothing is open on them (a menu, a dialog) or being typed into.
(function () {
if (!document.querySelector("[data-backup-pending]")) return;
var check = function () {
var pane = document.getElementById("backups");
var hidden = pane && pane.classList.contains("tab-pane") && !pane.classList.contains("active");
var busy = document.querySelector(".dropdown-menu.show, .modal.show");
var busy = document.querySelector(".dropdown-menu.show, .modal.show, input:focus, select:focus, textarea:focus");
if (hidden || busy || document.hidden) {
setTimeout(check, 4000);
} else {