From 93999ade0f0851285ecad497ff6864b827d948be Mon Sep 17 00:00:00 2001 From: Gerald Date: Mon, 31 Jul 2023 19:52:36 +0200 Subject: [PATCH] =?UTF-8?q?Prevent=20line=20break=20between=20power=20limi?= =?UTF-8?q?t=20value=20and=20its=20unit=20("%")=20and=20remove=20the=20spa?= =?UTF-8?q?ce=20between=20"=C2=B0=20C".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- User_Manual.md | 2 +- src/web/html/api.js | 3 +-- src/web/html/visualization.html | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/User_Manual.md b/User_Manual.md index a7be8f80..4d566474 100644 --- a/User_Manual.md +++ b/User_Manual.md @@ -63,7 +63,7 @@ The AhoyDTU will publish on the following topics |Q_AC | 21.200| actual AC reactive power in var| |F_AC | 49.990| actual AC Frequency in Hz| |PF_AC | 95.800| actual AC Power factor| -|Temp | 19.800|Temperature of inverter in Celsius| +|Temp | 19.800|Temperature of inverter in degree Celsius| |EVT | 9.000|Last Event/Alarm Message Index| |YieldDay | 51.000|Energy converted to AC per day in Watt hours (measured on DC)| |YieldTotal | 465.294|Energy converted to AC since reset Watt hours (measured on DC)| diff --git a/src/web/html/api.js b/src/web/html/api.js index 13ca50b5..5e99f58f 100644 --- a/src/web/html/api.js +++ b/src/web/html/api.js @@ -52,8 +52,7 @@ function ml(tagName, ...args) { function nester(el, n) { if (typeof n === "string") { - var t = document.createTextNode(n); - el.appendChild(t); + el.innerHTML = n; } else if (n instanceof Array) { for(var i = 0; i < n.length; i++) { if (typeof n[i] === "string") { diff --git a/src/web/html/visualization.html b/src/web/html/visualization.html index de5b0069..431dadd9 100644 --- a/src/web/html/visualization.html +++ b/src/web/html/visualization.html @@ -93,13 +93,13 @@ total[2] += obj.ch[0][6]; // YieldTotal total[3] += obj.ch[0][8]; // P_DC total[4] += obj.ch[0][10]; // Q_AC - var t = span(" ° C"); + var t = span(" °C"); return ml("div", {class: "row mt-2"}, ml("div", {class: "col"}, [ ml("div", {class: "p-2 iv-h"}, ml("div", {class: "row"}, [ ml("div", {class: "col mx-2 mx-md-1"}, obj.name), - ml("div", {class: "col a-c"}, "Power limit " + ((obj.power_limit_read == 65535) ? "n/a" : (obj.power_limit_read + " %"))), + ml("div", {class: "col a-c"}, "Power limit " + ((obj.power_limit_read == 65535) ? "n/a" : (obj.power_limit_read + " %"))), ml("div", {class: "col a-r mx-2 mx-md-1"}, String(obj.ch[0][5]) + t.innerHTML) ]) ),