mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 12:16:49 +00:00
Edit, Move, Detach, Unmount and a CD-ROM drive's Detach are outlined secondary buttons and Delete an outlined danger one, as on the Network and Snapshots tabs; Mount and Add disk stay the filled primary actions.
32 lines
2.4 KiB
HTML
32 lines
2.4 KiB
HTML
{% load i18n %}
|
|
{% load bootstrap_icons %}
|
|
{% load operations %}
|
|
{# the Move button of a disk and its dialog: another storage pool of this host #}
|
|
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#movedisk{{ id }}" title="{% trans "Move to another pool" %}">{% trans "Move" %}</button>
|
|
<div class="modal fade" id="movedisk{{ id }}" tabindex="-1" aria-labelledby="movedisk{{ id }}-label" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<form class="modal-content text-wrap" action="{% url 'instances:move_disk' instance.id %}" method="post">
|
|
{% csrf_token %}{% submission_key %}
|
|
<input type="hidden" name="dev" value="{{ disk.dev }}">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="movedisk{{ id }}-label">{% blocktrans with dev=disk.dev %}Move {{ dev }}{% endblocktrans %}</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<label class="form-label" for="movedisk{{ id }}-pool">{% trans "Storage pool" %}</label>
|
|
<select class="form-select" name="pool" id="movedisk{{ id }}-pool" required>
|
|
{% for storage in storages_host %}{% if storage != disk.storage %}<option value="{{ storage }}">{{ storage }}</option>{% endif %}{% endfor %}
|
|
</select>
|
|
{# no pool but the disk's own #}
|
|
{% if not storages_host or storages_host|length == 1 and disk.storage in storages_host %}
|
|
<div class="form-text text-danger">{% trans "The host has no other storage pool to move the disk to." %}</div>
|
|
{% endif %}
|
|
<div class="form-text text-break">{% blocktrans with path=disk.path %}The disk is copied into the pool, a running VM's without stopping it, and the VM uses the copy; {{ path }} is deleted then, unless a VM or volume of any host uses it.{% endblocktrans %}</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
|
|
<button type="submit" class="btn btn-primary"{% if not storages_host or storages_host|length == 1 and disk.storage in storages_host %} disabled{% endif %}>{% trans "Move" %}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|