From 13c009608be52c114d4adf6c8ef297013e725312 Mon Sep 17 00:00:00 2001 From: geronet1 Date: Sun, 9 Jun 2024 08:12:56 +0200 Subject: [PATCH] mobile display view without line break --- src/web/html/index.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/web/html/index.html b/src/web/html/index.html index 442160d4..ee78ac8e 100644 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -116,6 +116,8 @@ var p = div(["none"]); var total = 0; var count = 0; + var mobile = window.screen.width < 470; + for(var i of obj) { var icon = iconSuccess; var cl = "icon-success"; @@ -131,7 +133,8 @@ } else if(0 == i["ts_last_success"]) { avail = "{#AVAIL_NO_DATA}"; } else { - avail = "{#AVAIL} "; + if (!mobile) + avail = "{#AVAIL} "; if(false == i["is_producing"]) avail += "{#NOT_PRODUCING}"; else { @@ -142,11 +145,16 @@ } } + var text; + if (mobile) + text = "#"; + else + text = "{#INVERTER} #"; p.append( - svg(icon, 30, 30, "icon " + cl), - span("{#INVERTER} #" + i["id"] + ": " + i["name"] + " {#IS} " + avail), - br() - ); + svg(icon, 30, 30, "icon " + cl), + span(text + i["id"] + ": " + i["name"] + " {#IS} " + avail), + br() + ); if(false == i["is_avail"]) { if(i["ts_last_success"] > 0) {