parameters update

This commit is contained in:
Ivan 2023-09-26 13:24:42 +03:00
parent 371826da09
commit fdda0bef3f
Signed by untrusted user who does not match committer: ppechenkoo
GPG Key ID: 0C191B86D9582583
3 changed files with 39 additions and 9 deletions

View File

@ -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
}
};

View File

@ -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;

View File

@ -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 {