From 39baae7114fe1f630ced6750e9648728c4a2d525 Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Tue, 13 Nov 2018 11:09:45 +0300 Subject: [PATCH 1/1] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=BE=20=D1=81=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B5=20?= =?utf8?q?=D0=B2=20=D0=B2=D0=B5=D0=B1-=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84?= =?utf8?q?=D0=B5=D0=B9=D1=81=D0=B5=20=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD?= =?utf8?q?=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20(=D1=82?= =?utf8?q?=D0=B8=D0=BF=D0=B0=20=D1=81=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B?= =?utf8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=B0=D1=82=D1=87=D0=B8?= =?utf8?q?=D0=BA=D0=B0=20=D0=BF=D1=80=D0=B8=D1=81=D1=83=D1=82=D1=81=D1=82?= =?utf8?q?=D0=B2=D0=B8=D1=8F=20=D0=B8=D0=BB=D0=B8=20=D1=82=D0=B5=D0=BC?= =?utf8?q?=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D1=83=D1=80=D1=8B=20=D0=BF=D1=80?= =?utf8?q?=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=BE=D1=80=D0=B0).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- openwrt-web/meteo/meteo.js | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/openwrt-web/meteo/meteo.js b/openwrt-web/meteo/meteo.js index f56bc2d..9060847 100644 --- a/openwrt-web/meteo/meteo.js +++ b/openwrt-web/meteo/meteo.js @@ -24,27 +24,29 @@ function RefreshPageState() { if (sensor != "timestamp") { for (var param in returnedData[sensor_id][sensor]) { sensor_path = sensor_id+"."+sensor+"."+param; - value = returnedData[sensor_id][sensor][param]; name = properties["names"][sensor_path]; - if (! name) { name = sensor_path; } - units = properties["units"][sensor_path]; - scale = properties["scale"][sensor_path]; - color = properties["colors"][sensor_path]; - if (scale) { - value = (scale[0] * value).toFixed(scale[1]); + if (! name.startsWith("-")) { + value = returnedData[sensor_id][sensor][param]; + if (! name) { name = sensor_path; } + units = properties["units"][sensor_path]; + scale = properties["scale"][sensor_path]; + color = properties["colors"][sensor_path]; + if (scale) { + value = (scale[0] * value).toFixed(scale[1]); + } + if (! color) { + color = value_color; + } + var section = template.replace(/\$SENSOR_ID/g,sensor_id); + section = section.replace(/\$SENSOR/g,sensor); + section = section.replace(/\$PARAM/g,param); + section = section.replace(/\$NAME/g,name); + section = section.replace(/\$UNITS/g,units); + section = section.replace(/\$VALUE/g,value); + section = section.replace(/\$COLOR/g,color); + section = section.replace(/\$TIMESTAMP/g,timestamp); + html = html + section; } - if (! color) { - color = value_color; - } - var section = template.replace(/\$SENSOR_ID/g,sensor_id); - section = section.replace(/\$SENSOR/g,sensor); - section = section.replace(/\$PARAM/g,param); - section = section.replace(/\$NAME/g,name); - section = section.replace(/\$UNITS/g,units); - section = section.replace(/\$VALUE/g,value); - section = section.replace(/\$COLOR/g,color); - section = section.replace(/\$TIMESTAMP/g,timestamp); - html = html + section; } } } -- 2.34.1