fix mobile menu
fix inverters in select `serial.html` #709
This commit is contained in:
lumapu 2023-02-25 09:23:42 +01:00
parent 3cfa564171
commit 53624e466b
5 changed files with 25 additions and 23 deletions

View file

@ -2,6 +2,10 @@
(starting from release version `0.5.66`)
## 0.5.92
* fix mobile menu
* fix inverters in select `serial.html` #709
## 0.5.91
* improved html and navi, navi is visible even when API dies #660
* reduced maximum allowed JSON size for API to 6000Bytes #660

View file

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 91
#define VERSION_PATCH 92
//-------------------------------------
typedef struct {

View file

@ -35,7 +35,7 @@ iconSuccess = [
*/
function topnav() {
toggle("topnav");
toggle("topnav", "mobile");
}
function parseNav(obj) {
@ -85,12 +85,12 @@ function setHide(id, hide) {
elm.classList.remove('hide');
}
function toggle(id) {
function toggle(id, cl="hide") {
var e = document.getElementById(id);
if(!e.classList.contains("hide"))
e.classList.add("hide");
if(!e.classList.contains(cl))
e.classList.add(cl);
else
e.classList.remove('hide');
e.classList.remove(cl);
}
function getAjax(url, ptr, method="GET", json=null) {

View file

@ -5,7 +5,6 @@
<span></span>
<span></span>
</a>
<div id="topnav" class="mobile">
<div id="topnav" class="mobile">
<a id="nav2" class="hide" href="/live">Live</a>
<a id="nav3" class="hide" href="/serial">Serial / Control</a>
@ -20,7 +19,6 @@
<a id="nav0" class="hide" href="/login">Login</a>
<a id="nav1" class="hide" href="/logout">Logout</a>
</div>
</div>
<div id="wifiicon" class="info"></div>
</div>

View file

@ -65,7 +65,7 @@
parseESP(obj);
window.setInterval("getAjax('/api/generic', parseGeneric)", 10000);
exeOnce = false;
getAjax("/api/setup", parse);
getAjax("/api/inverter/list", parse);
}
}
@ -74,8 +74,8 @@
if(null == root) return;
root = root.inverter;
for(var i = 0; i < root.inverter.length; i++) {
inv = root.inverter[i];
for(var i = 0; i < root.length; i++) {
inv = root[i];
var opt = document.createElement('option');
opt.value = inv.id;
opt.innerHTML = inv.name;