1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00
webvirtcloud/instances/templates/instances/destroy_tab.html
catborise b72e9b1442 feat(instances): a VM's destruction says what goes, and keeps what a kept file needs
The Destroy tab was a sub-tab with one sentence and a link; its
confirmation page said only "This action is irreversible!" over a
"Remove Instance's data" switch. The tab now shows the state and
"Review destruction". The owner chose the confirmation layout from
three rendered options: the VM and its host, that its definition,
saved state and snapshot records go and that a running VM is forced
off, two plans for the files (delete the disk files, or keep them), the
VM's disks, what is always kept, the NVRAM choice, and Cancel.

Codex reviewed destroying; this is fixed:

- A disk file that cannot be deleted keeps the files below it, which
  it needs: they were deleted after it, leaving it broken. The files
  are deleted overlays first (split_disk_paths_by_use orders them by
  how many files each grows from), and if the files a kept one needs
  cannot be read, none of the rest goes. A message names each file
  kept so, and a failed deletion says the VM is removed.
2026-10-30 22:19:31 +03:00

16 lines
786 B
HTML

{% load i18n %}
{% load vm_states %}
<div class="tab-pane" id="undefine" role="tabpanel">
{% vm_state instance.status as state %}
<div class="card">
<div class="card-body">
<p class="small text-body-secondary mb-2">{% trans "Destroy" %} · {{ state.0 }}</p>
{% if can_delete %}
<a href="{% url 'instances:destroy' instance.id %}" class="btn btn-danger mb-2">{% trans "Review destruction" %}</a>
<p class="small text-body-secondary mb-0">{% trans "The next page shows what goes and lets you keep the disk files." %}</p>
{% else %}
<p class="mb-0">{% trans "Only the owners allowed to delete this VM and administrators can destroy it." %}</p>
{% endif %}
</div>
</div>
</div>