1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

fix(instances): the VM page waits to reload while it is in use

A power state change reloaded the VM page at once, losing what the user
was typing in a form or a dialog left open (only an unsaved XML edit was
kept). It now waits while pageInUse(), as the VM list's poll does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-09 14:29:38 +03:00
parent 600c8d8566
commit 7625b327c4
2 changed files with 7 additions and 6 deletions

View file

@ -6,8 +6,8 @@ var vm_status = Number(vm_summary.dataset.status);
var status_poll = pollWhileVisible(5000, function () {
return $.getJSON(vm_summary.dataset.statusUrl);
}, function get_status(data) {
// an XML edit not saved yet stays: the reload waits until it is saved or undone
if (data['status'] != vm_status && !backgroundJobRunning && !(window.xmlEditUnsaved && window.xmlEditUnsaved())) {
// the page in use (a dialog open, a field in use, an XML edit not saved): the reload waits (poll.js)
if (data['status'] != vm_status && !backgroundJobRunning && !pageInUse()) {
window.location.reload();
}
});