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