Skip to content

Commit

Permalink
0.8.136
Browse files Browse the repository at this point in the history
* fix save settings for ESP32 devices #1720
  • Loading branch information
lumapu committed Aug 12, 2024
1 parent 83b386d commit 8217448
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
3 changes: 3 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Development Changes

## 0.8.136 - 2024-08-12
* fix save settings for ESP32 devices #1720

## 0.8.135 - 2024-08-11
* translated `/system` #1717
* added default pin seetings for opendtufusion board
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 135
#define VERSION_PATCH 136
//-------------------------------------
typedef struct {
uint8_t ch;
Expand Down
35 changes: 18 additions & 17 deletions src/web/html/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -682,20 +682,21 @@
}

function parseSys(obj) {
for(var i of [["device", "device_name"], ["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
document.getElementsByName(i[0])[0].value = obj[i[1]];
document.getElementsByName("hidd")[0].checked = obj["hidd"];
document.getElementsByName("device")[0].value = obj.device_name;
for(var i of [["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
document.getElementsByName(i[0])[0].value = obj.network[i[1]];
document.getElementsByName("hidd")[0].checked = obj.network.hidd;

document.getElementsByName("darkMode")[0].checked = obj["dark_mode"];
document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"];
document.getElementsByName("darkMode")[0].checked = obj.dark_mode;
document.getElementsByName("schedReboot")[0].checked = obj.sched_reboot;
e = document.getElementsByName("adminpwd")[0];
if(!obj["pwd_set"])
if(!obj.pwd_set)
e.value = "";
var d = document.getElementById("prot_mask");
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"];
var el = [];
for(var i = 0; i < 7; i++) {
var chk = ((obj["prot_mask"] & (1 << i)) == (1 << i));
var chk = ((obj.prot_mask & (1 << i)) == (1 << i));
el.push(mlCb("protMask" + i, a[i], chk))
}
d.append(...el);
Expand All @@ -720,7 +721,7 @@
document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt
}

ts = obj["ts_now"];
ts = obj.ts_now;
window.setInterval("tick()", 1000);
}

Expand Down Expand Up @@ -1330,23 +1331,23 @@

function parse(root) {
if(null != root) {
parseGeneric(root["generic"]);
parseSys(root["system"]);
parseStaticIp(root["static_ip"]);
parseMqtt(root["mqtt"]);
parseNtp(root["ntp"]);
parseSun(root["sun"]);
parseGeneric(root.generic);
parseSys(root.system);
parseStaticIp(root.static_ip);
parseMqtt(root.mqtt);
parseNtp(root.ntp);
parseSun(root.sun);
parsePinout(root.pinout);
parseNrfRadio(root["radioNrf"], root["pinout"]);
parseNrfRadio(root.radioNrf, root.pinout);
/*IF_ESP32*/
parseCmtRadio(root.radioCmt);
/*ENDIF_ESP32*/
/*IF_ETHERNET*/
parseEth(root.eth)
/*ENDIF_ETHERNET*/
parseSerial(root["serial"]);
parseSerial(root.serial);
/*IF_PLUGIN_DISPLAY*/
parseDisplay(root["display"], root["system"]["esp_type"], root["system"]);
parseDisplay(root.display, root.system.esp_type, root.system);
/*ENDIF_PLUGIN_DISPLAY*/
getAjax("/api/inverter/list", parseIv);
}
Expand Down

0 comments on commit 8217448

Please sign in to comment.