Total Summe in Übersicht

This commit is contained in:
geronet1 2024-04-12 11:46:46 +02:00
parent c1cdb1b06c
commit 1a9da99f74

View file

@ -14,6 +14,7 @@
</p>
<p>
<span class="des">System Infos:</span>
<div id="total"></div>
<div id="iv"></div>
<div class="hr"></div>
<div id="warn_info"></div>
@ -111,6 +112,8 @@
function parseIv(obj, ts) {
var p = div(["none"]);
var total = 0;
var count = 0;
for(var i of obj) {
var icon = iconSuccess;
var cl = "icon-success";
@ -132,6 +135,8 @@
else {
icon = iconSuccessFull;
avail += "{#PRODUCING} " + i.cur_pwr + " W";
total += i.cur_pwr;
count += 1;
}
}
@ -149,6 +154,12 @@
}
}
document.getElementById("iv").replaceChildren(p);
if (count > 1) {
p.append(svg(iconInfo, 30, 30, "icon icon-info"), span("Total: " + total + " W"), br());
document.getElementById("total").replaceChildren(p);
document.getElementById("total").appendChild(div(["class=\"hr\""]));
}
}
function parseWarn(warn) {