fix linting
This commit is contained in:
parent
2f20992e7c
commit
eb71f57427
@ -44,7 +44,7 @@ class LocalDB {
|
||||
}
|
||||
|
||||
addUser (username, config = null) {
|
||||
config = config ? config : this.#data.global.defaultuser;
|
||||
config = config || this.#data.global.defaultuser;
|
||||
this.#data.users[username] = config;
|
||||
this.#save();
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ global.argv = parseArgs(process.argv.slice(2), {
|
||||
global.api = _package(global.argv.package);
|
||||
global.pve = pve;
|
||||
global.utils = utils;
|
||||
const db = (await import(global.argv.db)).default;
|
||||
global.db = new db(global.argv.dbconfig);
|
||||
const DB = (await import(global.argv.db)).default;
|
||||
global.db = new DB(global.argv.dbconfig);
|
||||
|
||||
const app = express();
|
||||
global.app = app;
|
||||
|
@ -240,14 +240,16 @@ export async function getNodeAvailDevices (node) {
|
||||
// get node pci devices
|
||||
let nodeAvailPci = requestPVE(`/nodes/${node}/hardware/pci`, "GET", { token: pveAPIToken });
|
||||
// for each node container, get its config and remove devices which are already used
|
||||
let vms = (await requestPVE(`/nodes/${node}/qemu`, "GET", { token: pveAPIToken })).data.data;
|
||||
const vms = (await requestPVE(`/nodes/${node}/qemu`, "GET", { token: pveAPIToken })).data.data;
|
||||
|
||||
const promises = [];
|
||||
for (const vm of vms) {
|
||||
promises.push(requestPVE(`/nodes/${node}/qemu/${vm.vmid}/config`, "GET", { token: pveAPIToken }));
|
||||
}
|
||||
const configs = await Promise.all(promises);
|
||||
configs.forEach((e,i) => {configs[i] = e.data.data});
|
||||
configs.forEach((e, i) => {
|
||||
configs[i] = e.data.data;
|
||||
});
|
||||
|
||||
nodeAvailPci = (await nodeAvailPci).data.data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user