1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/instances/templates/instances/move_disk.html
catborise a492652a24 feat(instances): the VM page's add dialogs in the panel's dialog look
The Add disk, Add network device and bandwidth dialogs of the VM page
set their labels in a narrow column beside the fields and closed with
a grey Close: Add disk split "GB" over two lines and offered an
unexplained Metadata box, its existing-volume pool was a dropdown of
links that wrote a hidden field; the network list prefixed every
choice with "Network" or "Interface"; the bandwidth fields asked for
"kilobytes" where libvirt counts KiB/s and KiB.

Now their labels sit above the fields, tied to them, in two columns.
Add disk is one form whose source, New disk or Existing volume, is a
radio card as in the new VM form, the chosen source's fields shown and
sent and its action taken; the size has a GiB suffix and
"Preallocate metadata (qcow2)", the existing volume's pool is a select
that loads its volumes, the bus and the cache are shared. Add network
device picks its
source from Networks and Interfaces groups and says how its MAC is
filled; the bandwidth limit names its units and when a running VM gets
it. Move says when the host has no other pool and is disabled then.
Every dialog closes with Cancel and its action; the posted fields are
unchanged.
2026-10-31 18:35:09 +03:00

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-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>