From f2da3882dc5e4308b060aa1e2bd082ef5b3838ca Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 17 Jan 2023 12:29:10 -0800 Subject: [PATCH] ensure node search returns a node Signed-off-by: Arthur Lu --- scripts/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/index.js b/scripts/index.js index 90f7444..d8ef5e6 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -32,7 +32,7 @@ async function populateInstances () { resources.data.forEach((element) => { if (element.type === "lxc" || element.type === "qemu") { let nodeName = element.node; - let nodeStatus = resources.data.find(item => item.node === nodeName).status; + let nodeStatus = resources.data.find(item => item.node === nodeName && item.type === "node").status; element.node = {name: nodeName, status: nodeStatus}; instances.push(element); }