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 @@ <div class="horizontal-line"></div> <div id="checkboxContainer"></div> - - - <div class="horizontal-line"></div> + <div class="parameters-inputs"> + <div class="parameters-input"> + <label for="system-ai-dsmfe">AI BOX</label> + <select name="DSMFE" id="system-ai-dsmfe"> + <option value="0">Выключено</option> + <option value="1">Включено</option> + </select> + </div> + <div style="float: right;" class="parameters-input"> + <label for="system-ai-rwfe">R-Watch</label> + <select name="RWFE" id="system-ai-rwfe"> + <option value="0">Выключено</option> + <option value="1">Включено</option> + </select> + </div> + </div> + + <div class="horizontal-line"></div> + + <button onclick="sendPutRequest('ai');" type="button">Сохранить</button> </div> @@ -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 {