diff --git a/server.js b/server.js index 67e6316..aeb8b33 100644 --- a/server.js +++ b/server.js @@ -2802,12 +2802,14 @@ app.put('/install-parameters', async (req, res) => { const { serial } = req.query; const { - SP + SP, + M } = requestData; const requestBody = { "MCMS": { + "M": parseInt(M, 10), "SP": SP } }; diff --git a/static/scripts/parameters-form.js b/static/scripts/parameters-form.js index afcd92f..88de46f 100644 --- a/static/scripts/parameters-form.js +++ b/static/scripts/parameters-form.js @@ -268,12 +268,16 @@ for (let radioButton of radioButtons) { console.log(data.DATA); - console.log(decodeCHValue(data.DATA.MCMS.M)); + const decodedValues = decodeCHValue(data.DATA.MCMS.M); + console.log(decodedValues); clearServerContainer(); - data.DATA.MCMS.SP.forEach((data) => { - addServer(data); + decodedValues.forEach((value, index) => { + const dataIndex = value - 1; + if (data.DATA.MCMS.SP[dataIndex]) { + addServer(data.DATA.MCMS.SP[dataIndex]); + } }); $("select").trigger("input"); diff --git a/static/templates/devices/device.html b/static/templates/devices/device.html index 4c83568..5b39d6e 100644 --- a/static/templates/devices/device.html +++ b/static/templates/devices/device.html @@ -162,7 +162,6 @@ -