mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(instances): the disk Edit dialog on one page, and an empty serial stays empty
The disk Edit dialog showed a disk without a serial as "None" in its Serial box, so saving it untouched gave the disk the serial "None". The box and the format box are now empty for a missing value. The dialog also hid most of its nine fields behind three tabs, said nothing about a running VM, greyed the bus without a reason and its switch labels did not toggle them. Now one body shows the disk's bus, format and size under the title; a running VM's note that the changes apply at its next start; the path and the Read-only and Shareable switches in a Source card; the four performance modes in a grid; and the bus, serial and image format folded under Device, with why the bus is locked and that changing the format does not convert the image. Cancel is outlined and Save the primary action.
This commit is contained in:
parent
2e17661390
commit
26a10d127a
2 changed files with 88 additions and 78 deletions
|
|
@ -112,6 +112,16 @@ class PendingEditsTestCase(TestCase):
|
|||
# the used share as a bar, full when a qcow2 file outgrows its capacity
|
||||
self.assertEqual(doc.xpath("//div[@id='disks']//div[@role='progressbar']/@aria-valuenow"), ["50", "100"])
|
||||
|
||||
def test_the_disk_edit_dialog_keeps_an_empty_serial_empty(self):
|
||||
disks = [disk("vda", "default", None)]
|
||||
doc = self.page(live=disks, config=disks)
|
||||
# saved untouched, the dialog must not give the disk the serial "None"
|
||||
self.assertEqual(doc.xpath("//div[@id='editvol0']//input[@name='vol_serial']/@value"), [""])
|
||||
# each switch's label toggles it
|
||||
for name in ("vol_readonly", "vol_shareable"):
|
||||
(switch,) = doc.xpath("//div[@id='editvol0']//input[@name=$n]", n=name)
|
||||
self.assertEqual(doc.xpath("//div[@id='editvol0']//label[@for=$i]", i=switch.get("id"))[0].tag, "label")
|
||||
|
||||
def test_the_clone_form_lists_the_persistent_devices(self):
|
||||
nic = {"type": "network", "mac": "52:54:10:00:00:01", "nic": "default", "state": "up", "model": "virtio",
|
||||
"ipv4": None, "ipv6": None, "filterref": "", "target": "", "inbound": [], "outbound": []}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue