Browse Source

0.8.136

* fix save settings for ESP32 devices #1720
main
lumapu 5 months ago
parent
commit
8217448d3e
  1. 3
      src/CHANGES.md
  2. 2
      src/defines.h
  3. 35
      src/web/html/setup.html

3
src/CHANGES.md

@ -1,5 +1,8 @@
# Development Changes # Development Changes
## 0.8.136 - 2024-08-12
* fix save settings for ESP32 devices #1720
## 0.8.135 - 2024-08-11 ## 0.8.135 - 2024-08-11
* translated `/system` #1717 * translated `/system` #1717
* added default pin seetings for opendtufusion board * added default pin seetings for opendtufusion board

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 135 #define VERSION_PATCH 136
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {
uint8_t ch; uint8_t ch;

35
src/web/html/setup.html

@ -682,20 +682,21 @@
} }
function parseSys(obj) { function parseSys(obj) {
for(var i of [["device", "device_name"], ["ssid", "ssid"], ["ap_pwd", "ap_pwd"]]) document.getElementsByName("device")[0].value = obj.device_name;
document.getElementsByName(i[0])[0].value = obj[i[1]]; for(var i of [["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
document.getElementsByName("hidd")[0].checked = obj["hidd"]; 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("darkMode")[0].checked = obj.dark_mode;
document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"]; document.getElementsByName("schedReboot")[0].checked = obj.sched_reboot;
e = document.getElementsByName("adminpwd")[0]; e = document.getElementsByName("adminpwd")[0];
if(!obj["pwd_set"]) if(!obj.pwd_set)
e.value = ""; e.value = "";
var d = document.getElementById("prot_mask"); var d = document.getElementById("prot_mask");
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"]; var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"];
var el = []; var el = [];
for(var i = 0; i < 7; i++) { 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)) el.push(mlCb("protMask" + i, a[i], chk))
} }
d.append(...el); d.append(...el);
@ -720,7 +721,7 @@
document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt
} }
ts = obj["ts_now"]; ts = obj.ts_now;
window.setInterval("tick()", 1000); window.setInterval("tick()", 1000);
} }
@ -1330,23 +1331,23 @@
function parse(root) { function parse(root) {
if(null != root) { if(null != root) {
parseGeneric(root["generic"]); parseGeneric(root.generic);
parseSys(root["system"]); parseSys(root.system);
parseStaticIp(root["static_ip"]); parseStaticIp(root.static_ip);
parseMqtt(root["mqtt"]); parseMqtt(root.mqtt);
parseNtp(root["ntp"]); parseNtp(root.ntp);
parseSun(root["sun"]); parseSun(root.sun);
parsePinout(root.pinout); parsePinout(root.pinout);
parseNrfRadio(root["radioNrf"], root["pinout"]); parseNrfRadio(root.radioNrf, root.pinout);
/*IF_ESP32*/ /*IF_ESP32*/
parseCmtRadio(root.radioCmt); parseCmtRadio(root.radioCmt);
/*ENDIF_ESP32*/ /*ENDIF_ESP32*/
/*IF_ETHERNET*/ /*IF_ETHERNET*/
parseEth(root.eth) parseEth(root.eth)
/*ENDIF_ETHERNET*/ /*ENDIF_ETHERNET*/
parseSerial(root["serial"]); parseSerial(root.serial);
/*IF_PLUGIN_DISPLAY*/ /*IF_PLUGIN_DISPLAY*/
parseDisplay(root["display"], root["system"]["esp_type"], root["system"]); parseDisplay(root.display, root.system.esp_type, root.system);
/*ENDIF_PLUGIN_DISPLAY*/ /*ENDIF_PLUGIN_DISPLAY*/
getAjax("/api/inverter/list", parseIv); getAjax("/api/inverter/list", parseIv);
} }

Loading…
Cancel
Save