From ab5410218d0f06bbdd332d5864dae61d0d2b9a70 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 20 Dec 2022 16:47:49 -0800 Subject: [PATCH] parse disk to only use size --- scripts/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/config.js b/scripts/config.js index c77f042..f02e5d4 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -29,7 +29,10 @@ async function populateForm (node, type, vmid) { let i = 0; while(Object.hasOwn(config.data, `sata${i}`)){ - addFormLine(`sata${i}`, `SATA ${i}`, {type: "text", value: config.data[`sata${i}`]}); + let sata = config.data[`sata${i}`]; + sata = `{"${sata.replaceAll(":", '":"').replaceAll("=", '":"').replaceAll(",", '","')}"}`; + sata = JSON.parse(sata); + addFormLine(`sata${i}`, `SATA ${i}`, {type: "text", value: sata.size}); i++; } }