From f5b0c29109656316854122affc2ceb5f7116e071 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 11 May 2023 07:13:41 +0000 Subject: [PATCH] fix requestPVE call params --- scripts/account.js | 1 - scripts/config.js | 6 +++--- scripts/index.js | 2 +- scripts/instance.js | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/account.js b/scripts/account.js index 06deacb..7a14fa7 100644 --- a/scripts/account.js +++ b/scripts/account.js @@ -15,7 +15,6 @@ async function init () { if (cookie === "") { goToPage("login.html"); } - let user = await requestAPI("/user"); let resources = user.resources; let instances = user.instances; diff --git a/scripts/config.js b/scripts/config.js index c0bc5ed..4549763 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -260,7 +260,7 @@ async function handleDiskResize () { async function handleDiskMove () { let content = type === "qemu" ? "images" : "rootdir"; - let storage = await requestPVE(`/nodes/${node}/storage`, "GET", null); + let storage = await requestPVE(`/nodes/${node}/storage`, "GET"); let header = `Move ${this.dataset.disk}`; @@ -331,7 +331,7 @@ async function handleDiskDelete () { async function handleDiskAdd () { let content = type === "qemu" ? "images" : "rootdir"; - let storage = await requestPVE(`/nodes/${node}/storage`, "GET", null); + let storage = await requestPVE(`/nodes/${node}/storage`, "GET"); let header = "Create New Disk"; @@ -375,7 +375,7 @@ async function handleDiskAdd () { async function handleCDAdd () { let content = "iso"; - let storage = await requestPVE(`/nodes/${node}/storage`, "GET", null); + let storage = await requestPVE(`/nodes/${node}/storage`, "GET"); let header = `Add a CDROM`; diff --git a/scripts/index.js b/scripts/index.js index 8b038f6..fd49e26 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -16,7 +16,7 @@ async function init () { } async function populateInstances () { - let resources = await requestPVE("/cluster/resources", "GET", null); + let resources = await requestPVE("/cluster/resources", "GET"); let instanceContainer = document.getElementById("instance-container"); let instances = []; diff --git a/scripts/instance.js b/scripts/instance.js index ae48b18..4ac74bb 100644 --- a/scripts/instance.js +++ b/scripts/instance.js @@ -135,7 +135,7 @@ export class Instance extends HTMLElement { const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay)); while (true) { - let taskStatus = await requestPVE(`/nodes/${this.node.name}/tasks/${result.data}/status`); + let taskStatus = await requestPVE(`/nodes/${this.node.name}/tasks/${result.data}/status`, "GET"); if(taskStatus.data.status === "stopped" && taskStatus.data.exitstatus === "OK") { // task stopped and was successful this.status = targetStatus; this.update();