Compare commits

...

2 commits

Author SHA1 Message Date
aa068444a1 dashboard gauge wip 2025-04-07 21:42:19 +02:00
97e59c61d8 dashboard gauge wip 2025-04-07 21:25:31 +02:00
2 changed files with 7 additions and 6 deletions

View file

@ -348,7 +348,7 @@ a.disabled {
}
.gauge { height: calc(60px + 3em); }
.gauge { height: calc(60px + 3.5em); }
.gauge__container { width: 120px; height: 60px; }
.gauge__marker { height: 60px; left: 59.5px; }
.gauge__background { width: 120px; height: 60px; }
@ -357,13 +357,13 @@ a.disabled {
.gauge__needle { left: 60px; top: 58px; width: 60px; }
.gauge__labels { top: 60px; width: 120px; }
.gauge__label--low { width: 24px; }
.gauge__label--spacer { width: 72px; text-align: center;}
.gauge__label--spacer { width: 120px; text-align: center;}
.gauge__label--high { width: 24px; }
.gaugeLabel { text-align: center; }
@media only screen and (min-width: 720px) {
.gauge { height: calc(120px + 4.2em); }
.gauge { height: calc(120px + 5em); }
.gauge__container { width: 240px; height: 120px; }
.gauge__marker { height: 120px; left: 119.5px; }
.gauge__background { width: 240px; height: 120px; }
@ -372,7 +372,7 @@ a.disabled {
.gauge__needle { left: 120px; top: 117px; width: 120px; }
.gauge__labels { top: 120px; width: 240px; }
.gauge__label--low { width: 48px; }
.gauge__label--spacer { width: 144px; text-align: center;}
.gauge__label--spacer { width: 240px; text-align: center;}
.gauge__label--high { width: 48px; }
.gaugeLabel { font-size: 1.3em; }
.gauge__labels { font-size: 2em; }

View file

@ -8,6 +8,7 @@
#include "Page_root_HTML.h"
/* TODO make this configurable some nice day */
const byte Max_Dashboard_Gauge_PerLine = 3;
// https://techtutorialsx.com/2018/07/23/esp32-arduino-http-server-template-processing-with-multiple-placeholders/
@ -51,8 +52,8 @@ String Proc_WebPage_root(const String& var) {
html += config.grow.dashboard.gaugeRead[i];
html += F("' style='float:left; ");
/* if it is the last gauge, dont add a margin */
if((gaugeNrLine < Max_Dashboard_Gauge_PerLine) || (gaugeNr < gaugeCount)) {
/* if it is the last gauge (from the line), dont add a margin */
if(((gaugeNrLine < Max_Dashboard_Gauge_PerLine) && (gaugeNr < gaugeCount)) ) {
html += F("margin-right: 10px;'>");
} else {
html += F("'>");