mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-31 01:36:11 +02:00
improved html and navi, navi is visible even when API dies #660
reduced maximum allowed JSON size for API to 6000Bytes #660 small fix: output command at `prepareDevInformCmd` #692 improved inverter handling for MQTT #671
This commit is contained in:
parent
9ef2df21fa
commit
4f0d365211
21 changed files with 279 additions and 377 deletions
|
@ -38,18 +38,21 @@ function topnav() {
|
|||
toggle("topnav");
|
||||
}
|
||||
|
||||
function parseMenu(obj) {
|
||||
var e = document.getElementById("topnav");
|
||||
e.innerHTML = "";
|
||||
for(var i = 0; i < obj["name"].length; i ++) {
|
||||
if(obj["name"][i] == "-")
|
||||
e.appendChild(span("", ["seperator"]));
|
||||
else {
|
||||
var l = link(obj["link"][i], obj["name"][i], obj["trgt"][i]);
|
||||
if(obj["link"][i] == window.location.pathname)
|
||||
l.classList.add("active");
|
||||
e.appendChild(l);
|
||||
}
|
||||
function parseNav(obj) {
|
||||
for(i = 0; i < 7; i++) {
|
||||
var l = document.getElementById("nav"+i);
|
||||
if(window.location.pathname == "/" + l.href.split('/').pop())
|
||||
l.classList.add("active");
|
||||
|
||||
if(obj["menu_protEn"]) {
|
||||
if(obj["menu_prot"]) {
|
||||
if((((obj["menu_mask"] >> i) & 0x01) == 0x01) || (1 == i))
|
||||
l.classList.remove("hide");
|
||||
|
||||
} else if(0 == i)
|
||||
l.classList.remove("hide");
|
||||
} else if(i > 1)
|
||||
l.classList.remove("hide");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue