fix bugs in api changes

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-05-18 20:19:57 +00:00
parent bff5ca3929
commit 928d1d1516
2 changed files with 4 additions and 1 deletions

View File

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

View File

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