From 22f334f373f65577b22193c4723ce837948e203c Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 15 Dec 2022 23:08:56 -0800 Subject: [PATCH] fix power management request --- scripts/elements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/elements.js b/scripts/elements.js index 59bffbf..c766e0c 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -60,7 +60,7 @@ class Instance extends HTMLElement { powerButton.src = data.status === "running" ? "images/actions/stop.svg" : "images/actions/start.svg"; powerButton.addEventListener("click", () => { let targetState = this.status == "running" ? "shutdown" : "start"; - let data = request(`/nodes/${this.node}/${this.type}/${this.vmid}/status/${targetState}`); + let data = request(`/nodes/${this.node}/${this.type}/${this.vmid}/status/${targetState}`, "POST", {node: this.node, vmid: this.vmid}); console.log(data); this.status = this.status === "running" ? "stopped" : "running"; });