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