1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 01:16:10 +00:00
webvirtcloud/vmbackups/templates/vmbackups/delete_form.html
catborise fc87a3034e fix(vmbackups): clearer backup pages; a deletion stays on its page
Deleting a backup took the user to the generic job page, which named
neither the backup nor a way back. The deletion now stays on the page it
was asked from, says which backup is being deleted, shows the row as
being deleted and reads the page again until it is gone. The confirm
dialog is 'Delete backup' and names the target and that it cannot be
undone; the job's label names the VM and the backup's time.

The lists keep a VM's and a target's name and a row's actions on one
line, link a backup's job only when it is being made (Progress) or failed
(Why?), and say 'While shut off' for an offline backup. The schedule form
puts the full-backup setting on a row of its own and the schedule list
shows it; the restore form starts on the VM's host.
2026-11-17 20:14:12 +03:00

12 lines
1.8 KiB
HTML

{% load i18n %}{% load operations %}{% load bootstrap_icons %}{% if backup.state != "deleting" and backup.uuid|stringformat:"s" not in pending_deletes %}<div class="d-inline-flex gap-1 justify-content-end">{% if backup.state == "ready" %}<div class="btn-group">
{# fixed: the menu would be cut off by the table's scrolling box #}
<button class="btn btn-sm btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"
data-bs-popper-config='{"strategy": "fixed"}'>{% trans "Restore" %}</button>
<ul class="dropdown-menu dropdown-menu-end shadow">
<li><a class="dropdown-item" href="{% url 'vmbackups:restore' backup.uuid %}">{% trans "As a new VM" %}</a></li>
{% if backup.instance_id %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_over' backup.uuid %}">{% trans "Over the VM" %}</a></li>{% endif %}
{% if user.is_superuser %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_disk' backup.uuid %}">{% trans "One disk" %}</a></li>{% endif %}
</ul>
</div>{% endif %}{% if backup.state != "creating" %}{% if user.is_superuser or backup.taken_by_id == user.id and not backup.policy_id %}<form method="post" action="{% url 'vmbackups:delete' backup.uuid %}" class="d-inline">{% csrf_token %}{% submission_key %}
<button type="submit" class="btn btn-sm btn-outline-danger" aria-label="{% trans "Delete backup" %}" title="{% trans "Delete backup" %}"
data-confirm="{% blocktrans with time=backup.created_at|date:"Y-m-d H:i" vm=backup.vm_name target=backup.target.name %}Delete the backup of {{ vm }} taken {{ time }}? Its files are removed from {{ target }}; this cannot be undone.{% endblocktrans %}">{% bs_icon 'trash' %}</button></form>{% endif %}{% endif %}</div>{% endif %}