make body optional parameter for request function
This commit is contained in:
parent
5cee249285
commit
ad9969c393
@ -16,9 +16,9 @@ async function init () {
|
||||
let newNode = document.createElement("node-article");
|
||||
newNode.data = nodes.data[i];
|
||||
|
||||
let qemu = await request(`/nodes/${nodes.data[i].node}/qemu`, "GET", null);
|
||||
let qemu = await request(`/nodes/${nodes.data[i].node}/qemu`, "GET");
|
||||
qemu.data.sort((a, b) => (a.vmid > b.vmid) ? 1 : -1);
|
||||
let lxc = await request(`/nodes/${nodes.data[i].node}/lxc`, "GET", null);
|
||||
let lxc = await request(`/nodes/${nodes.data[i].node}/lxc`, "GET");
|
||||
lxc.data.sort((a, b) => (a.vmid > b.vmid) ? 1 : -1);
|
||||
newNode.qemu = qemu.data;
|
||||
newNode.lxc = lxc.data;
|
||||
|
@ -24,7 +24,7 @@ export function setTicket (ticket) {
|
||||
document.cookie = `PVEAuthCookie=${ticket}; path=/; expires=${d.toUTCString()}; domain=.tronnet.net`;
|
||||
}
|
||||
|
||||
export async function request (path, method, body, auth = true) {
|
||||
export async function request (path, method, body = null, auth = true) {
|
||||
let prms = new URLSearchParams(body);
|
||||
|
||||
let content = {
|
||||
|
Loading…
Reference in New Issue
Block a user