1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00
webvirtcloud/vmbackups/templates/vmbackups/index.html
catborise bd5d42e65a fix(vmbackups): third audit: retention keep, target changes, import
- A retention deletion checks the schedule's keep and later dependants
  once the target is reached, right before deleting: keep raised while
  the target connection waited no longer loses the backup.
- Pool and target changes on the target page take the target claim, so
  an import or backup running into the target keeps the pools it uses.
- Import reads a manifest only with its definition and a disk; an
  unreadable manifest is skipped and listed, the others are imported.
- The backups list shows 50 a page and keeps its filter across pages.
2026-11-18 08:29:22 +03:00

83 lines
5.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% load django_bootstrap5 %}
{% load operations %}
{% block title %}{% trans "Backups" %}{% endblock %}
{% block page_heading %}{% trans "Backups" %}{% endblock page_heading %}
{% block page_heading_extra %}<a class="btn btn-outline-primary btn-sm" href="{% url 'vmbackups:policies' %}">{% bs_icon 'list-task' %} {% trans "Schedules" %}</a>
<a class="btn btn-outline-primary btn-sm" href="{% url 'vmbackups:targets' %}">{% bs_icon 'hdd-network' %} {% trans "Backup targets" %}</a>{% endblock page_heading_extra %}
{% block content %}
<form method="get" class="row g-2 mb-3" aria-label="{% trans "Filter" %}">
<div class="col-12 col-md">
<label class="visually-hidden" for="filter-vm">{% trans "VM" %}</label>
<input type="search" class="form-control" id="filter-vm" name="vm" value="{{ vm }}" placeholder="{% trans "VM name" %}">
</div>
<div class="col-6 col-md-auto">
<label class="visually-hidden" for="filter-target">{% trans "Target" %}</label>
<select class="form-select" id="filter-target" name="target">
<option value="">{% trans "All targets" %}</option>
{% for t in targets %}<option value="{{ t.id }}"{% if target == t.id|stringformat:"d" %} selected{% endif %}>{{ t.name }}</option>{% endfor %}
</select>
</div>
<div class="col-6 col-md-auto">
<label class="visually-hidden" for="filter-state">{% trans "State" %}</label>
<select class="form-select" id="filter-state" name="state">
<option value="">{% trans "All states" %}</option>
<option value="ready"{% if state == "ready" %} selected{% endif %}>{% trans "Ready" %}</option>
<option value="creating"{% if state == "creating" %} selected{% endif %}>{% trans "Creating" %}</option>
<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>
</select>
</div>
<div class="col-12 col-md-auto d-grid">
<button type="submit" class="btn btn-outline-secondary">{% bs_icon 'filter' %} {% trans "Filter" %}</button>
</div>
</form>
{% if rows %}
<div class="table-responsive">
<table class="table table-hover align-middle" id="backups">
<thead>
{# on a phone: time, VM, state and actions; the rest from wider screens #}
<tr><th>{% trans "Time" %}</th><th>{% trans "VM" %}</th>
<th class="d-none d-md-table-cell">{% trans "Consistency" %}</th>
<th class="text-end d-none d-sm-table-cell">{% trans "Size" %}</th><th>{% trans "State" %}</th><th></th></tr>
</thead>
<tbody>
{% for backup in rows %}
<tr>
{# date and time wrap apart on a phone #}
<td class="text-nowrap">{{ backup.created_at|date:"Y-m-d" }}<br class="d-sm-none"><span class="d-none d-sm-inline"> </span>{{ backup.created_at|date:"H:i" }}
<div class="small text-body-secondary text-nowrap" title="{% trans "Target" %}">{{ backup.target.name }}</div></td>
<td style="max-width: min(12rem, 30vw);">{# a long name is cut, whole on hover #}
{% if backup.instance %}<a class="d-inline-block text-truncate mw-100 align-bottom" title="{{ backup.vm_name }}" href="{% url 'instances:instance' backup.instance.id %}">{{ backup.vm_name }}</a>
{% else %}<span class="d-inline-block text-truncate mw-100 align-bottom" title="{{ backup.vm_name }}">{{ backup.vm_name }}</span> <span class="badge text-bg-secondary">{% trans "removed" %}</span>{% endif %}
<div class="small text-body-secondary text-truncate">{{ backup.compute_name }}{% if backup.policy %}, <a href="{% url 'vmbackups:policy' backup.policy_id %}" title="{% trans "Schedule" %}">{{ backup.policy.name }}</a>{% endif %}</div>
</td>
<td class="d-none d-md-table-cell">{% include "vmbackups/consistency.html" %}</td>
<td class="text-end text-nowrap d-none d-sm-table-cell">{% if backup.size %}{{ backup.size|filesizeformat }}{% else %}–{% endif %}</td>
<td>{% include "vmbackups/state.html" %}</td>
<td class="text-end">{% include "vmbackups/delete_form.html" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if page.has_other_pages %}
{% bootstrap_pagination page extra=page_query pages_to_show=5 extra_classes="flex-wrap" %}
{% endif %}
{% elif vm or target or state %}
<div class="alert alert-info">{% trans "No backup matches the filter." %}</div>
{% else %}
<div class="alert alert-info">{% trans "No backup yet. Back a VM up from its Backups tab." %}</div>
{% endif %}
{% endblock %}
{% block script %}<script src="{% static 'vmbackups/pending.js' %}"></script>{% endblock %}