From fdda0bef3f7815569b99a9ace22e32fd54790f54 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 26 Sep 2023 13:24:42 +0300 Subject: [PATCH] parameters update --- server.js | 8 +++++-- static/scripts/parameters-form.js | 8 ++++--- static/templates/devices/system.html | 32 ++++++++++++++++++++++++---- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/server.js b/server.js index 316ac39..befc8d0 100644 --- a/server.js +++ b/server.js @@ -2692,12 +2692,16 @@ app.put('/ai-parameters', async (req, res) => { const { serial } = req.query; const { - DSMA + DSMA, + DSMFE, + RWFE } = requestData; const requestBody = { "DSM": { - "DSMA": DSMA + "DSMA": DSMA, + "DSMFE": DSMFE, + "RWFE": RWFE } }; diff --git a/static/scripts/parameters-form.js b/static/scripts/parameters-form.js index 71322c6..6f4deb1 100644 --- a/static/scripts/parameters-form.js +++ b/static/scripts/parameters-form.js @@ -296,6 +296,11 @@ for (let radioButton of radioButtons) { camerasData = data; console.log(data.DATA); + + document.getElementById('system-ai-dsmfe').value = data.DATA.DSM.DSMFE; + document.getElementById('system-ai-rwfe').value = data.DATA.DSM.RWFE; + + givenData = data.DATA.DSM.DSMA; var desiredCameras; @@ -312,11 +317,8 @@ for (let radioButton of radioButtons) { let newCH; - - function updateFields(selectedIndex) { const selectedData = givenData[selectedIndex]; - console.log(selectedData); document.getElementById("system-ai-en1").value = selectedData.EN; document.getElementById("system-ai-as1").value = selectedData.AS; diff --git a/static/templates/devices/system.html b/static/templates/devices/system.html index c98afd8..425118d 100644 --- a/static/templates/devices/system.html +++ b/static/templates/devices/system.html @@ -559,12 +559,29 @@
- - -
+
+
+ + +
+
+ + +
+
+ +
+ + @@ -1139,8 +1156,15 @@ updateDataInArray(); const DSMA = givenData; console.log(DSMA); +const DSMFE = parseInt(document.getElementById('system-ai-dsmfe').value); +const RWFE = parseInt(document.getElementById('system-ai-rwfe').value); + + + const requestData = { - DSMA + DSMA, + DSMFE, + RWFE }; try {