1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

Merge branch 'master' of github.com:wellenvogel/esp32-nmea2000

This commit is contained in:
andreas
2023-01-09 16:45:15 +01:00
16 changed files with 310 additions and 149 deletions

View File

@@ -236,16 +236,24 @@ function changeConfig() {
ensurePass()
.then(function (pass) {
let newAdminPass;
let url = "/api/setConfig?_hash="+encodeURIComponent(pass)+"&";
let url = "/api/setConfig"
let body="_hash="+encodeURIComponent(pass)+"&";
let allValues=getAllConfigs();
if (!allValues) return;
for (let name in allValues){
if (name == 'adminPassword'){
newAdminPass=allValues[name];
}
url += name + "=" + encodeURIComponent(allValues[name]) + "&";
body += encodeURIComponent(name) + "=" + encodeURIComponent(allValues[name]) + "&";
}
getJson(url)
fetch(url,{
method:'POST',
headers:{
'Content-Type': 'application/octet-stream' //we must lie here
},
body: body
})
.then((rs)=>rs.json())
.then(function (status) {
if (status.status == 'OK') {
if (newAdminPass !== undefined) {