From: gregor herrmann Date: Thu, 6 Sep 2018 15:35:24 +0000 (+0200) Subject: reload from the correct different API endpoints for air and water X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/a0668e798825ed7294cd0f0e5beb6e4bd0884e41 reload from the correct different API endpoints for air and water --- diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index d023575..ff430ff 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -160,13 +160,24 @@ function dayschart(element, title, days, xtickformat) { }); // reload data in charts + // TODO: this is basically the same as the unused loaddays function below setInterval( function() { - chart.load({ - url: api_base_url_sensors + beginend(days), - mimeType: 'json' - }); - chart.flush(); + if (element.substr(0, 7) == 'chart_w') { + console.log("water"); + chart.load({ + url: api_base_url_sensors + beginend(days), + mimeType: 'json' + }); + chart.flush(); + } else { + console.log("air"); + chart.load({ + url: api_base_url_weather + beginend(days), + mimeType: 'json' + }); + chart.flush(); + } }, refresh_interval );