mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-31 01:36:11 +02:00
fix total in GUI
This commit is contained in:
parent
90955b91f6
commit
b8ed9b03d7
2 changed files with 7 additions and 1 deletions
|
@ -57,6 +57,7 @@ monitor_filters =
|
|||
;default ; Remove typical terminal control codes from input
|
||||
time ; Add timestamp with milliseconds for each new line
|
||||
;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory
|
||||
esp8266_exception_decoder, default
|
||||
|
||||
[env:esp8266-debug]
|
||||
platform = espressif8266
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
}
|
||||
|
||||
function totals() {
|
||||
for(var i = 0; i < 5; i++) {
|
||||
var total[i] = Math.round(total[i] * 100) / 100;
|
||||
}
|
||||
|
||||
return ml("div", {class: "row mt-3 mb-5"},
|
||||
ml("div", {class: "col"}, [
|
||||
ml("div", {class: "p-2 total-h"},
|
||||
|
@ -85,7 +89,7 @@
|
|||
}
|
||||
function ivHead(obj) {
|
||||
total[0] += obj.ch[0][2]; // P_AC
|
||||
total[1] += obj.ch[0][7]/1000; // YieldDay
|
||||
total[1] += obj.ch[0][7]; // YieldDay
|
||||
total[2] += obj.ch[0][6]; // YieldTotal
|
||||
total[3] += obj.ch[0][8]; // P_DC
|
||||
total[4] += obj.ch[0][10]; // Q_AC
|
||||
|
@ -209,6 +213,7 @@
|
|||
ivEn = Object.values(Object.assign({}, obj["iv"]));
|
||||
mIvHtml = [];
|
||||
mNum = 0;
|
||||
total.fill(0);
|
||||
for(var i = 0; i < obj.iv.length; i++) {
|
||||
if(obj.iv[i])
|
||||
getAjax("/api/inverter/id/" + i, parseIv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue