From 0f778fe9f01ca584e7fb86be38640510e62d568a Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 29 Oct 2026 22:54:56 +0300 Subject: [PATCH] feat(instances): a VM's disks as cards, its CD-ROM drives above them 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. --- instances/templates/add_instance_volume.html | 4 +- .../instances/edit_instance_volume.html | 38 ++- instances/templates/instances/move_disk.html | 4 +- .../templates/instances/settings_tab.html | 289 +++++++----------- instances/tests/test_new_disk_name.py | 14 +- instances/tests/test_pending_edits.py | 10 +- instances/views.py | 6 +- static/icon_cache/disc_None_None_None.svg | 11 + 8 files changed, 169 insertions(+), 207 deletions(-) create mode 100644 static/icon_cache/disc_None_None_None.svg diff --git a/instances/templates/add_instance_volume.html b/instances/templates/add_instance_volume.html index 6b13c17e..7801387a 100644 --- a/instances/templates/add_instance_volume.html +++ b/instances/templates/add_instance_volume.html @@ -1,9 +1,7 @@ {% load i18n %} {% load bootstrap_icons %} {% if request.user.is_superuser %} - - - + {% bs_icon 'plus' %} {% trans "Add disk" %}