diff --git a/css/dialog.css b/css/dialog.css
index 55105ff..b5fd25e 100644
--- a/css/dialog.css
+++ b/css/dialog.css
@@ -2,6 +2,7 @@ dialog {
background-color: #000000;
border: 1px solid white;
border-radius: 5px;
+ padding: 10px;
}
dialog::backdrop {
@@ -12,7 +13,8 @@ dialog .btn-group {
margin-top: 10px;
}
-h1, h2, h3, p {
- margin: 10px;
+#prompt {
text-align: center;
+ margin-bottom: 10px;
+ margin-top: 0px;
}
\ No newline at end of file
diff --git a/scripts/config.js b/scripts/config.js
index 0950a41..75fc164 100644
--- a/scripts/config.js
+++ b/scripts/config.js
@@ -242,6 +242,8 @@ async function handleDiskMove () {
let dialog = document.createElement("dialog-form");
document.body.append(dialog);
+ dialog.header = `Move ${this.id}`;
+
let label = document.createElement("label");
label.for = "storage-select";
label.innerText = "Storage";
@@ -257,7 +259,23 @@ async function handleDiskMove () {
dialog.append(storageSelect);
- dialog.callback = () => {
+ dialog.callback = async (result, form) => {
+ if(result === "confirm") {
+ let body = {
+ node: node,
+ type: type,
+ vmid: vmid,
+ action: JSON.stringify({storage: storageSelect.value, disk: this.id})
+ }
+ let result = await requestAPI("/disk/move", "POST", body);
+ if (result.status === 200) {
+ await getConfig();
+ populateDisk();
+ }
+ else{
+ console.error(result);
+ }
+ }
document.querySelector("dialog-form").remove();
};
diff --git a/scripts/elements.js b/scripts/elements.js
index 3e4c9da..14d28f6 100644
--- a/scripts/elements.js
+++ b/scripts/elements.js
@@ -143,7 +143,7 @@ export class Dialog extends HTMLElement {