diff --git a/css/form.css b/css/form.css index 0b368b7..45d246e 100644 --- a/css/form.css +++ b/css/form.css @@ -73,4 +73,8 @@ input[type="radio"] { display: inline-block; width: 100%; margin-top: 5px; +} + +dialog { + max-width: calc(min(50%, 80ch)); } \ No newline at end of file diff --git a/instance.html b/instance.html index e06d1fc..b624a4e 100644 --- a/instance.html +++ b/instance.html @@ -52,7 +52,7 @@ diff --git a/scripts/account.js b/scripts/account.js index 55d7ce6..e989459 100644 --- a/scripts/account.js +++ b/scripts/account.js @@ -250,7 +250,7 @@ function handlePasswordChangeForm () { if (result === "confirm") { const result = await requestAPI("/access/password", "POST", { password: form.get("new-password") }); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to change password but got: ${result.error}`); } } }); diff --git a/scripts/index.js b/scripts/index.js index 72ac419..ea51406 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -196,7 +196,7 @@ class InstanceCard extends HTMLElement { } else if (taskStatus.data.status === "stopped") { // task stopped but was not successful this.status = prevStatus; - alert(`attempted to ${targetAction} ${this.vmid} but process returned stopped:${result.data.exitstatus}`); + alert(`Attempted to ${targetAction} ${this.vmid} but got: ${taskStatus.data.exitstatus}`); this.update(); this.actionLock = false; break; @@ -246,7 +246,7 @@ class InstanceCard extends HTMLElement { } } else { - alert(result.error); + alert(`Attempted to delete ${this.vmid} but got: ${result.error}`); this.status = this.prevStatus; this.update(); this.actionLock = false; @@ -430,7 +430,7 @@ async function handleInstanceAdd () { populateInstances(); } else { - alert(result.error); + alert(`Attempted to create new instance ${vmid} but got: ${result.error}`); populateInstances(); } } diff --git a/scripts/instance.js b/scripts/instance.js index 0b2a6c2..3dfd6dd 100644 --- a/scripts/instance.js +++ b/scripts/instance.js @@ -220,7 +220,7 @@ async function handleDiskDetach () { setSVGSrc(document.querySelector(`svg[data-disk="${disk}"]`), "images/status/loading.svg"); const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/detach`, "POST"); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to detach ${disk} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -249,7 +249,7 @@ async function handleDiskAttach () { const disk = `${prefix}${device}`; const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/attach`, "POST", body); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to attach ${this.dataset.disk} to ${disk} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -276,7 +276,7 @@ async function handleDiskResize () { }; const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/resize`, "POST", body); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to resize ${disk} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -317,7 +317,7 @@ async function handleDiskMove () { }; const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/move`, "POST", body); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to move ${disk} to ${body.storage} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -336,7 +336,7 @@ async function handleDiskDelete () { setSVGSrc(document.querySelector(`svg[data-disk="${disk}"]`), "images/status/loading.svg"); const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/delete`, "DELETE"); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to delete ${disk} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -378,7 +378,7 @@ async function handleDiskAdd () { const disk = `${prefix}${id}`; const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/disk/${disk}/create`, "POST", body); if (result.status !== 200) { - alert(result.error); + alert(`Attempted to create ${disk} but got: ${result.error}`); } await getConfig(); populateDisk(); @@ -390,7 +390,7 @@ async function handleDiskAdd () { async function handleCDAdd () { const isos = await requestAPI("/user/vm-isos", "GET"); - const header = "Add a CDROM"; + const header = "Mount a CDROM"; const body = `