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

feat(computes): a box on the Computes page tells what wants a look

Above the hosts, linked to where each is handled: hosts not answering,
pools filled to 85% (as last measured), VMs with snapshots older than 30
days, backup jobs failed and backups a schedule did not take in the last 7
days (per schedule; not for a host in maintenance), backups missing or
damaged (a new Damaged filter on the Backups page), and jobs that ended
uncertain or wait for over an hour. Nothing to look at: no box. The pools
and snapshots are read on threads of their own, waited for 2 seconds at
most: one slow host leaves out its lines, not the page.
This commit is contained in:
catborise 2026-11-19 22:29:29 +03:00
parent 2c0855cf64
commit 5c7687c60d
13 changed files with 468 additions and 89 deletions

View file

@ -34,6 +34,7 @@
<option value="failed"{% if state == "failed" %} selected{% endif %}>{% trans "Failed" %}</option>
<option value="deleting"{% if state == "deleting" %} selected{% endif %}>{% trans "Deleting" %}</option>
<option value="missing"{% if state == "missing" %} selected{% endif %}>{% trans "Missing" %}</option>
<option value="damaged"{% if state == "damaged" %} selected{% endif %}>{% trans "Damaged" %}</option>
</select>
</div>
<div class="col-12 col-md-auto d-grid">

View file

@ -205,6 +205,8 @@ def index(request):
rows = rows.filter(target_id=int(target))
if state in dict(Backup.STATES):
rows = rows.filter(state=state)
elif state == "damaged": # ready, but a verification found damage
rows = rows.filter(state=Backup.READY).exclude(damage=[])
# schedules add a backup of each VM a night: the list is read a page at a time, as the jobs are
page = Paginator(rows, 50).get_page(request.GET.get("page"))
return render(request, "vmbackups/index.html", {