Обработка неопределенных значений в веб-интерфейсе.
authorRoman Bazalevsky <rvb@rvb.name>
Tue, 31 Dec 2019 14:44:36 +0000 (17:44 +0300)
committerRoman Bazalevsky <rvb@rvb.name>
Tue, 31 Dec 2019 14:45:12 +0000 (17:45 +0300)
openwrt-web/meteo/meteo.js

index 9060847fccbd5ac57e8dfae18d749faed2ec3c9f..36ff690eb91604665b9a9cf08db6feabc9fa1781 100644 (file)
@@ -25,7 +25,7 @@ function RefreshPageState() {
             for (var param in returnedData[sensor_id][sensor]) {
               sensor_path = sensor_id+"."+sensor+"."+param;
               name = properties["names"][sensor_path];
             for (var param in returnedData[sensor_id][sensor]) {
               sensor_path = sensor_id+"."+sensor+"."+param;
               name = properties["names"][sensor_path];
-              if (! name.startsWith("-")) {
+              if ((! name.startsWith("-")) && (name != "undefined")) {
                 value = returnedData[sensor_id][sensor][param];
                 if (! name) { name = sensor_path; }
                 units = properties["units"][sensor_path];
                 value = returnedData[sensor_id][sensor][param];
                 if (! name) { name = sensor_path; }
                 units = properties["units"][sensor_path];