mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 09:26:03 +00:00
The confirmation page put "on <host>" in its heading for every owner who may delete the VM, while the VM list and page show the host only to superusers and users with view_instances.
56 lines
3.5 KiB
HTML
56 lines
3.5 KiB
HTML
{% extends 'base.html' %}
|
|
{% load i18n %}
|
|
{% load operations %}
|
|
{% block title %}{% blocktrans with name=instance.name %}Destroy {{ name }}{% endblocktrans %}{% endblock title %}
|
|
|
|
{% block page_heading %}
|
|
{% blocktrans with name=instance.name %}Destroy {{ name }}{% endblocktrans %}{% if perms.instances.view_instances %} <small class="text-body-secondary fs-6">{% blocktrans with host=instance.compute.name %}on {{ host }}{% endblocktrans %}</small>{% endif %}
|
|
{% endblock page_heading %}
|
|
|
|
{% block content %}
|
|
<p class="small">{% trans "The VM's definition, saved state and snapshot records are removed. A running VM is forced off first; what the guest has not written to disk is lost." %}</p>
|
|
<form action="{% url 'instances:destroy' instance.id %}" method="post" id="delete_form">{% csrf_token %}{% submission_key %}
|
|
<fieldset class="mb-3">
|
|
<legend class="h6">{% trans "What should happen to the files?" %}</legend>
|
|
<div class="row g-2">
|
|
<div class="col-12 col-md-6">
|
|
<label class="border rounded p-3 d-block h-100">
|
|
<input class="form-check-input me-2" type="radio" name="delete_disk" value="true" checked>
|
|
<strong>{% trans "Delete disk files" %}</strong>
|
|
<span class="small d-block mt-2">{% trans "With them go this VM's external snapshot files, snapshot memory files and cloud-init seed." %}</span>
|
|
</label>
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="border rounded p-3 d-block h-100">
|
|
<input class="form-check-input me-2" type="radio" name="delete_disk" value="false">
|
|
<strong>{% trans "Keep the disk files" %}</strong>
|
|
<span class="small d-block mt-2">{% trans "They stay with their internal snapshot data; the snapshot records still go with the VM." %}</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
{% if instance.config_disks %}
|
|
<p class="small fw-semibold mb-1">{% trans "Disks" %}</p>
|
|
<ul class="small ps-3">
|
|
{% for disk in instance.config_disks %}
|
|
<li><strong>{{ disk.dev }}</strong> <span class="text-break">{{ disk.path|default:_("no file") }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
<p class="small text-body-secondary">{% trans "A file another VM uses on any of the panel's hosts, directly or under its own disk, is kept, and so is the template a disk was made from. If a host cannot be checked, the VM is not destroyed." %}</p>
|
|
{% if instance.nvram %}
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" name="delete_nvram" value="true" id="delete_nvram" checked>
|
|
<label class="form-check-label" for="delete_nvram">{% trans "Delete the NVRAM file (firmware settings). Untick to keep it." %}</label>
|
|
</div>
|
|
{% endif %}
|
|
{% if instance.config_tpm == "emulator" %}
|
|
<p class="small text-body-secondary" id="destroy-tpm">{% trans "Its TPM state is deleted with it, and the keys in it, such as BitLocker's." %}</p>
|
|
{% endif %}
|
|
<div class="border-top pt-3 d-flex flex-wrap align-items-center gap-2">
|
|
<span class="small text-danger me-auto">{% trans "This cannot be undone." %}</span>
|
|
<a class="btn btn-secondary" href="{% url 'instances:instance' instance.id %}">{% trans "Cancel" %}</a>
|
|
<button class="btn btn-danger" type="submit" name="delete">{% trans "Destroy VM" %}</button>
|
|
</div>
|
|
</form>
|
|
{% endblock content %}
|