fix bug with adding multiple pci devices

This commit is contained in:
2025-01-06 20:33:15 +00:00
parent 7626dcf387
commit 3001febbc2
3 changed files with 20 additions and 11 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { Router } from "express";
import { token } from "morgan";
export const router = Router({ mergeParams: true }); ;
const checkAuth = global.utils.checkAuth;
@@ -177,7 +178,7 @@ router.post("/create", async (req, res) => {
// force all functions
params.device = params.device.split(".")[0];
// get instance config to find next available hostpci slot
const config = global.pve.requestPVE(`/nodes/${params.node}/${params.type}/${params.vmid}/config`, "GET", { cookies: params.cookies });
const config = (await global.pve.requestPVE(`/nodes/${params.node}/${params.type}/${params.vmid}/config`, "GET", { token: true })).data.data;
let hostpci = 0;
while (config[`hostpci${hostpci}`]) {
hostpci++;