@@ -112,7 +112,7 @@ function renderLog(el, ls, nm) {
112112 } ) ;
113113}
114114
115- function batteryInfo ( ) {
115+ function batteryInfo ( ) {
116116 const overlay = document . getElementById ( "batInfoOverlay" ) ;
117117 overlay . classList . add ( "active" ) ;
118118}
@@ -145,8 +145,8 @@ function renderConsStats(dayIdx) {
145145 const yAxis = document . getElementById ( "statsYAxis" ) ;
146146 if ( yAxis ) {
147147 yAxis . innerHTML = "" ;
148- [ maxVal + " Wh" , Math . round ( maxVal / 2 ) + " Wh" , "0 Wh" ] . forEach ( v => {
149- const s = document . createElement ( "span" ) ; s . textContent = v ; yAxis . appendChild ( s ) ;
148+ [ maxVal , Math . round ( maxVal / 2 ) , 0 ] . forEach ( v => {
149+ const s = document . createElement ( "span" ) ; s . textContent = ( v + " Wh" ) ; yAxis . appendChild ( s ) ;
150150 } ) ;
151151 }
152152 const bars = document . getElementById ( "statsBars" ) ;
@@ -157,7 +157,7 @@ function renderConsStats(dayIdx) {
157157 const bar = document . createElement ( "div" ) ;
158158 bar . className = "bar" + ( h === new Date ( ) . getHours ( ) && dayIdx === new Date ( ) . getDay ( ) ? " bar-now" : "" ) ;
159159 bar . style . height = Math . round ( v / maxVal * 100 ) + "%" ;
160- bar . title = h + ":00 — " + v + " W " ;
160+ bar . title = h + ":00 — " + v + " Wh " ;
161161 col . appendChild ( bar ) ;
162162 bars . appendChild ( col ) ;
163163 } ) ;
@@ -172,7 +172,7 @@ function renderConsStats(dayIdx) {
172172 }
173173}
174174
175- function sendUpdate ( payload ) {
175+ function sendUpdate ( payload ) {
176176 fetch ( "/api/update" , {
177177 method : "POST" ,
178178 headers : {
@@ -182,18 +182,18 @@ function sendUpdate(payload){
182182 } ) ;
183183}
184184
185- function toggleLoadPowerFields ( isLoading ) {
185+ function toggleLoadPowerFields ( isLoading ) {
186186 document . getElementById ( "sn_loadpower" ) . disabled = isLoading ;
187187 const btn = document . getElementById ( "calibrateBtn" ) ;
188188 btn . disabled = isLoading ;
189- if ( isLoading ) {
189+ if ( isLoading ) {
190190 btn . classList . add ( "loading" ) ;
191- } else {
191+ } else {
192192 btn . classList . remove ( "loading" ) ;
193193 }
194194}
195195
196- function triggerCalibrate ( ) {
196+ function triggerCalibrate ( ) {
197197 toggleLoadPowerFields ( true ) ;
198198 sendUpdate ( "calibrate" ) ;
199199}
0 commit comments