added back watering route and hopefully fixed bug with graph
This commit is contained in:
@@ -29,12 +29,14 @@ var createChart = function() {
|
|||||||
self.temperatures = [];
|
self.temperatures = [];
|
||||||
Tracker.autorun(function() {
|
Tracker.autorun(function() {
|
||||||
sensor_data_collection().forEach(function(sensorReading) {
|
sensor_data_collection().forEach(function(sensorReading) {
|
||||||
self.labels.push(moment(sensorReading.lastBoxContact).format('ddd DD.MM. HH:mm:ss'));
|
if (sensorReading.temperatures) {
|
||||||
for (var i = 0; i < sensorReading.temperatures.length; i++) {
|
self.labels.push(moment(sensorReading.lastBoxContact).format('ddd DD.MM. HH:mm:ss'));
|
||||||
if (!self.temperatures[i]) {
|
for (var i = 0; i < sensorReading.temperatures.length; i++) {
|
||||||
self.temperatures[i] = [];
|
if (!self.temperatures[i]) {
|
||||||
|
self.temperatures[i] = [];
|
||||||
|
}
|
||||||
|
self.temperatures[i].push(sensorReading.temperatures[i]);
|
||||||
}
|
}
|
||||||
self.temperatures[i].push(sensorReading.temperatures[i]);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -187,7 +189,6 @@ Template.log.onRendered(function() {
|
|||||||
|
|
||||||
Template.log.resized = function() {
|
Template.log.resized = function() {
|
||||||
createChart();
|
createChart();
|
||||||
|
|
||||||
return Session.get('resize');
|
return Session.get('resize');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
Tracker.autorun(function() {
|
Tracker.autorun(function() {
|
||||||
var id = Session.get('controller_id');
|
var id = Session.get('controller_id');
|
||||||
|
Session.set("orientation", new Date());
|
||||||
|
Session.set("resize", new Date());
|
||||||
if (id) {
|
if (id) {
|
||||||
Meteor.subscribe("sensor_data", id);
|
Meteor.subscribe("sensor_data", id);
|
||||||
Meteor.subscribe("controller_state", id);
|
Meteor.subscribe("controller_state", id);
|
||||||
@@ -9,6 +11,6 @@ Tracker.autorun(function() {
|
|||||||
Session.set("orientation", new Date());
|
Session.set("orientation", new Date());
|
||||||
});
|
});
|
||||||
window.addEventListener('resize', function(){
|
window.addEventListener('resize', function(){
|
||||||
Session.set("resized", new Date());
|
Session.set("resize", new Date());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function saveParamsAndGo(where) {
|
|||||||
|
|
||||||
Template.tabs.events({
|
Template.tabs.events({
|
||||||
'click .start': function() {
|
'click .start': function() {
|
||||||
saveParamsAndGo('/');
|
saveParamsAndGo('/water');
|
||||||
},
|
},
|
||||||
'click .weather': function() {
|
'click .weather': function() {
|
||||||
saveParamsAndGo('/weather');
|
saveParamsAndGo('/weather');
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ function safeRoute(route) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Router.route('/', safeRoute('alarm'));
|
Router.route('/', safeRoute('alarm'));
|
||||||
|
Router.route('/water', safeRoute('start'));
|
||||||
Router.route('/alarm', safeRoute('alarm'));
|
Router.route('/alarm', safeRoute('alarm'));
|
||||||
Router.route('/log', safeRoute('log'));
|
Router.route('/log', safeRoute('log'));
|
||||||
Router.route('/surveillance', safeRoute('surveillance'));
|
Router.route('/surveillance', safeRoute('surveillance'));
|
||||||
|
|||||||
Reference in New Issue
Block a user