1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-23 00:00:02 +01:00
VILLASweb/app/routes/lab-mashup.js
2015-10-28 05:53:20 -04:00

49 lines
1 KiB
JavaScript

import Ember from 'ember';
import ENV from '../config/environment';
export default Ember.Route.extend({
model() {
return this.store.query('entity', { entities: [
{
id: 'S3_ElectricalGrid',
isPattern: false,
type: 'ElectricalGridMonitoring'
},
{
id: 'DataFileControl',
isPattern: false,
type: 'DataFileControl'
}
]});
//return this.store.findAll('entity');
},
afterModel() {
// first time call poll
Ember.run.later(this, function() {
this.refreshEntities();
}, ENV.APP.UPDATE_RATE);
},
refreshEntities: function() {
// fetch new data from server
this.store.query('entity', { entities: [
{
id: 'S3_ElectricalGrid',
isPattern: false,
type: 'ElectricalGridMonitoring'
},
{
id: 'DataFileControl',
isPattern: false,
type: 'DataFileControl'
}
]});
//this.store.findAll('entity');
// reschedule refresh
Ember.run.later(this, function() {
this.refreshEntities();
}, ENV.APP.UPDATE_RATE);
}
});