1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 12:16:49 +00:00
webvirtcloud/instances/templates/instances/destroy_instance_form.html
catborise be00b1cf8e fix(instances): a paused VM can be destroyed from its page
The Destroy button was disabled and the confirmation page refused a
paused VM ("Instance is suspended, cannot destroy!"), while the destroy
request itself stops a paused VM like a running one. Both now offer it.
2026-10-08 08:50:21 +03:00

38 lines
No EOL
1.4 KiB
HTML

{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans "Confirm Destroy" %}
{% endblock title %}
{% block page_heading %}
{% trans "Destroy instance" %} {{ instance }}
{% endblock page_heading %}
{% block content %}
{% if can_delete %}
<div class="alert alert-danger">
{% trans "This action is irreversible!" %}
</div>
<form action="{% url 'instances:destroy' instance.id %}" class="form" method="post" role="form" id="delete_form">{% csrf_token %}
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="delete_disk" value="true" checked id="delete_disk">
<label class="form-check-label fw-bold" for="delete_disk">{% trans "Remove Instance's data" %}</label>
</div>
{% if instance.nvram %}
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="delete_nvram" value="true" id="delete_nvram" checked>
<label class="form-check-label fw-bold" for="delete_nvram">
{% trans "Remove Instance's NVRAM" %}
</label>
</div>
{% endif %}
<button type="submit" class="btn btn-lg btn-success float-end" name="delete">
{% trans "Destroy" %}
</button>
</form>
{% else %}
<div class="alert alert-danger" role="alert">
{% trans "You cannot destroy instance!" %}
</div>
{% endif %}
{% endblock content %}