mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 04:36:48 +00:00
Settings > Disk was a bold title with an unlabelled "+", a CD-ROM row in an input group, and a table whose actions were four alike icons. The owner chose this layout from three rendered options: - Removable media: each CD-ROM drive a card with its device, bus and image, the ISO select and Mount (or Unmount), and Detach; "Add CD-ROM" by the heading. - Disks: a card each; one disk spans the row, two or more sit side by side from md, and the device details are capped at 32rem so values stay near their labels. The capacity large, the used size, the pool and the source path, the device's settings under "Device details" (they were in a popover), and labelled Edit, Move, Detach and Delete (danger) in its footer; "Add disk" by the heading. - While the VM runs, "Add CD-ROM" adds the drive on the SCSI bus, and a SCSI drive can be detached: IDE and SATA drives cannot be plugged into or out of a running VM, SCSI ones can. Adding a drive was disabled while the VM ran. One line says so, and why detaching other drives and detaching or deleting disks waits for a shutdown, instead of each button alone being greyed. The forms, their fields and actions are unchanged. The edit dialog of each disk is titled with its device, and its fields' ids carry the disk's number: the dialogs of two disks had the same ids, and the title was not the dialog's label.
28 lines
2 KiB
HTML
28 lines
2 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>
|
|
<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-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
|
|
<button type="submit" class="btn btn-primary">{% trans "Move" %}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|