diff --git a/config.html b/config.html index 607ee27..0752a65 100644 --- a/config.html +++ b/config.html @@ -21,7 +21,10 @@ Disks

-
Add New Disk
+
+ Add New Disk + Add New CDROM +
diff --git a/css/style.css b/css/style.css index 282bfd7..aa2f576 100644 --- a/css/style.css +++ b/css/style.css @@ -87,6 +87,10 @@ img.clickable { visibility: hidden; } +.none { + display: none; +} + .visuallyhidden { border: 0; clip: rect(0 0 0 0); diff --git a/images/actions/add-cd.svg b/images/actions/add-cd.svg new file mode 100644 index 0000000..2ff123b --- /dev/null +++ b/images/actions/add-cd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/actions/create.svg b/images/actions/add-disk.svg similarity index 100% rename from images/actions/create.svg rename to images/actions/add-disk.svg diff --git a/scripts/config.js b/scripts/config.js index 035149f..0d440cd 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -92,6 +92,16 @@ function populateDisk () { }); } document.querySelector("#disk-add").addEventListener("click", handleDiskAdd); + + if (type === "qemu") { + document.querySelector("#cd-add").classList.remove("none"); + document.querySelector("#cd-add").addEventListener("click", handleCDAdd); + } +} + +function getOrderedUsed(disks){ + let ordered_keys = Object.keys(disks).sort((a,b) => {parseInt(a) - parseInt(b)}); // ordered integer list + return ordered_keys; } function addDiskLine (fieldset, busPrefix, busName, device, diskDetails) { @@ -395,7 +405,4 @@ async function handleDiskAdd () { dialog.show(); } -function getOrderedUsed(disks){ - let ordered_keys = Object.keys(disks).sort((a,b) => {parseInt(a) - parseInt(b)}); // ordered integer list - return ordered_keys; -} \ No newline at end of file +async function handleCDAdd () {} \ No newline at end of file