fix requestPVE call params

This commit is contained in:
Arthur Lu 2023-05-11 07:13:41 +00:00
parent a8ad9986d7
commit c459dad024
4 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -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`;

View File

@ -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 = [];

View File

@ -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();