diff --git a/css/form.css b/css/form.css
index a0de5e0..64df664 100644
--- a/css/form.css
+++ b/css/form.css
@@ -1,4 +1,5 @@
.input-grid {
+ float: left;
display: grid;
column-gap: 10px;
row-gap: 5px;
@@ -15,6 +16,10 @@
}
legend {
+ float: left;
+ width: 100%;
+ margin: 0;
+ padding: 0;
line-height: 1.5em;
margin-top: 0.25lh;
margin-bottom: 0.25lh;
diff --git a/package.json b/package.json
index fd207a4..1f2d4a7 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "Front-end for ProxmoxAAS",
"type": "module",
"scripts": {
- "lint": "html-validator --continue; stylelint --fix **/*.css; eslint --fix .;"
+ "lint": "html-validator --continue; stylelint --formatter verbose --fix **/*.css; DEBUG=eslint:cli-engine eslint --fix ."
},
"devDependencies": {
"eslint": "^8.43.0",
diff --git a/scripts/config.js b/scripts/config.js
index b3ede09..281598f 100644
--- a/scripts/config.js
+++ b/scripts/config.js
@@ -548,7 +548,7 @@ async function handleNetworkDelete () {
const header = `Delete net${netID}`;
const body = "";
- const d = dialog(header, body, async (result, form) => {
+ dialog(header, body, async (result, form) => {
if (result === "confirm") {
document.querySelector(`img[data-network="${netID}"]`).src = "images/status/loading.svg";
const result = await requestAPI(`/${node}/${type}/${vmid}/net/net${netID}/delete`, "DELETE");
@@ -572,7 +572,7 @@ async function handleNetworkAdd () {
body += "
";
}
- const d = dialog(header, body, async (result, form) => {
+ dialog(header, body, async (result, form) => {
if (result === "confirm") {
const body = {
rate: form.get("rate")
@@ -702,7 +702,7 @@ async function handleDeviceDelete () {
const header = `Remove Expansion Card ${deviceID}`;
const body = "";
- const d = dialog(header, body, async (result, form) => {
+ dialog(header, body, async (result, form) => {
if (result === "confirm") {
document.querySelector(`img[data-device="${deviceID}"]`).src = "images/status/loading.svg";
const result = await requestAPI(`/${node}/${type}/${vmid}/pci/hostpci${deviceID}/delete`, "DELETE");
diff --git a/scripts/dialog.js b/scripts/dialog.js
index 9abb2c3..fa9e28f 100644
--- a/scripts/dialog.js
+++ b/scripts/dialog.js
@@ -11,15 +11,12 @@ export function dialog (header, body, callback = async (result, form) => { }) {
dialog.className = "w3-container w3-card w3-border-0";
dialog.querySelector("#prompt").innerText = header;
dialog.querySelector("form").innerHTML = body;
-
- document.body.append(dialog);
- dialog.showModal();
-
dialog.addEventListener("close", async () => {
await callback(dialog.returnValue, new FormData(dialog.querySelector("form")));
dialog.parentElement.removeChild(dialog);
});
-
+ document.body.append(dialog);
+ dialog.showModal();
return dialog;
}