Files
old-tfm/app/client/log.js
2016-02-28 11:19:18 +01:00

28 lines
523 B
JavaScript

function sensor_data_collection() {
var controllerId = Session.get('controller_id');
return SensorData.find({
controllerId: controllerId
}, {
sort: {
created_at: -1
},
limit: 100
});
}
Template.log.helpers({
sensorDataCollection: sensor_data_collection
});
Template.log.events({
'click clear_log': function() {
Meteor.call('clearLog');
}
});
Template.sensorData.helpers({
created_at_formatted: function() {
return moment(this.created_at).format("DD.MM.YYYY, HH:mm")
}
});