Browse Source

Merge pull request #421 from DanielR92/dev03

Insert board type in footer + fix footer space
pull/423/head
Lukas Pusch 2 years ago
committed by GitHub
parent
commit
df3391df82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/.gitignore
  2. 4
      src/web/html/api.js
  3. 17
      src/web/html/index.html
  4. 2
      src/web/html/style.css

5
src/.gitignore

@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

4
src/web/html/api.js

@ -27,6 +27,10 @@ function parseVersion(obj) {
); );
} }
function parseESP(obj) {
document.getElementById("esp_type").innerHTML="Board: " + obj["esp_type"];
}
function setHide(id, hide) { function setHide(id, hide) {
var elm = document.getElementById(id); var elm = document.getElementById(id);
if(hide) { if(hide) {

17
src/web/html/index.html

@ -73,8 +73,11 @@
</ul> </ul>
</div> </div>
<div class="right"> <div class="right">
<span id="version"></span><br/><br/> <ul>
<a href="https://creativecommons.org/licenses/by-nc-sa/3.0/de" target="_blank" >CC BY-NC-SA 3.0</a> <li><span id="version"></span></li>
<li><span id="esp_type"></span></li>
<li><a href="https://creativecommons.org/licenses/by-nc-sa/3.0/de" target="_blank" >CC BY-NC-SA 3.0</a></li>
</ul>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@ -101,8 +104,10 @@
function parseSys(obj) { function parseSys(obj) {
// Disclaimer // Disclaimer
//if(obj["disclaimer"] == false) sessionStorage.setItem("gDisclaimer", promptFunction()); //if(obj["disclaimer"] == false) sessionStorage.setItem("gDisclaimer", promptFunction());
if(true == exeOnce) if(exeOnce){
parseVersion(obj); parseVersion(obj);
parseESP(obj);
}
document.getElementById("wifi_rssi").innerHTML = obj["wifi_rssi"]; document.getElementById("wifi_rssi").innerHTML = obj["wifi_rssi"];
var date = new Date(obj["ts_now"] * 1000); var date = new Date(obj["ts_now"] * 1000);
@ -128,7 +133,7 @@
dSpan.appendChild(span("", ["span"], "apiResult")); dSpan.appendChild(span("", ["span"], "apiResult"));
e.addEventListener("click", setTime); e.addEventListener("click", setTime);
} }
if(!obj["ts_sun_upd"]) { if(!obj["ts_sun_upd"]) {
var e = document.getElementById("sun"); var e = document.getElementById("sun");
if(null != e) if(null != e)
@ -185,14 +190,14 @@
function parse(obj) { function parse(obj) {
if(null != obj) { if(null != obj) {
if(true == exeOnce) if(exeOnce)
parseMenu(obj["menu"]); parseMenu(obj["menu"]);
parseSys(obj["system"]); parseSys(obj["system"]);
parseStat(obj["statistics"]); parseStat(obj["statistics"]);
parseIv(obj["inverter"]); parseIv(obj["inverter"]);
parseWarnInfo(obj["warnings"], obj["infos"]); parseWarnInfo(obj["warnings"], obj["infos"]);
document.getElementById("refresh").innerHTML = obj["refresh_interval"]; document.getElementById("refresh").innerHTML = obj["refresh_interval"];
if(true == exeOnce) { if(exeOnce) {
window.setInterval("getAjax('/api/index', parse)", obj["refresh_interval"] * 1000); window.setInterval("getAjax('/api/index', parse)", obj["refresh_interval"] * 1000);
exeOnce = false; exeOnce = false;
} }

2
src/web/html/style.css

@ -90,7 +90,7 @@ span.seperator {
#footer .right { #footer .right {
color: #bbb; color: #bbb;
margin: 23px 25px; margin: 6px 25px;
text-align: right; text-align: right;
} }

Loading…
Cancel
Save