implement pcie device add and delete endpoints,

change getDeviceInfo to return primary device with sun devices listed,
fix bug in approveResources when checking list type resources
This commit is contained in:
Arthur Lu
2023-06-22 00:23:34 +00:00
parent 49192daac6
commit 19f38fa25d
5 changed files with 179 additions and 32 deletions

View File

@@ -58,7 +58,8 @@ export async function approveResources(req, username, request) {
approved = false;
}
else if (resources[key].type === "list") {
if (avail[key].includes(request[key]) != resources[key].whitelist) {
let inAvail = avail[key].some(availElem => request[key].includes(availElem));
if (inAvail != resources[key].whitelist) {
approved = false;
}
}