// reload data in charts
setInterval(
function() {
- chart.load({
- url: api_base_url_sensors + beginend(days),
- mimeType: 'json'
- });
- chart.flush();
+ loaddays(chart, element, days);
},
refresh_interval
);
airtime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']);
})
.catch(function(error) {
- // handle error
+ console.log(error);
});
fetch(api_url_currentwater)
.then((resp) => resp.json())
watertime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']);
})
.catch(function(error) {
- // handle error
+ console.log(error);
});
},
refresh_interval