From 928d1d1516be9ce1247ef3a10f9ebee7a684112e Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 18 May 2023 20:19:57 +0000 Subject: [PATCH] fix bugs in api changes Signed-off-by: Arthur Lu --- scripts/config.js | 3 +++ scripts/index.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/config.js b/scripts/config.js index 46f5725..4fefa6d 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -519,6 +519,9 @@ async function handleFormExit() { cores: document.querySelector("#Cores").value, memory: document.querySelector("#Memory").value } + if (type === "lxc") { + body.swap = document.querySelector("#Swap").value; + } let result = await requestAPI("/instance/resources", "POST", body); if (result.status === 200) { await getConfig(); diff --git a/scripts/index.js b/scripts/index.js index 4994414..7e9a392 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -156,7 +156,7 @@ async function handleInstanceAdd() { let clusterNodes = await requestPVE("/nodes", "GET"); let allowedNodes = await requestAPI("/user/nodes", "GET"); clusterNodes.data.forEach((element) => { - if (element.status === "online" && allowedNodes.includes(element.node)) { + if (element.status === "online" && allowedNodes.nodes.includes(element.node)) { nodeSelect.add(new Option(element.node)); } });