servers parameters update
This commit is contained in:
parent
33668b7906
commit
f5f0171a6c
@ -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
|
||||
}
|
||||
};
|
||||
|
@ -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");
|
||||
|
@ -162,7 +162,6 @@
|
||||
</section>
|
||||
|
||||
|
||||
<img src="../img/xmark.svg" id="close-form-btn">
|
||||
<form id="edit-form" enctype="multipart/form-data" method="post" action="/updatedevice">
|
||||
|
||||
<div id="details" class="new-parameters active">
|
||||
|
@ -1302,6 +1302,14 @@ const requestBody = {
|
||||
|
||||
if (type === 'install') {
|
||||
|
||||
var serverContainer = document.getElementById('server-container');
|
||||
|
||||
var servers = serverContainer.getElementsByClassName('server');
|
||||
|
||||
var serverNumbersArray = Array.from({ length: servers.length }, (_, index) => index + 1);
|
||||
|
||||
const M = encodeCHValue(serverNumbersArray);
|
||||
|
||||
const deleteConfirmation = document.getElementById("addInformation");
|
||||
const loader = document.getElementById("loader");
|
||||
const status = document.getElementById("status");
|
||||
@ -1316,12 +1324,14 @@ const requestBody = {
|
||||
saveData();
|
||||
|
||||
const SP = serverData;
|
||||
console.log(SP);
|
||||
|
||||
const requestData = {
|
||||
SP
|
||||
SP,
|
||||
M
|
||||
};
|
||||
|
||||
console.log(requestData);
|
||||
|
||||
try {
|
||||
const response = await fetch(`/install-parameters?serial=${serial}`, {
|
||||
method: 'PUT',
|
||||
|
Loading…
Reference in New Issue
Block a user