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
2016-07-27 18:08:31 +02:00

59 lines
1.2 KiB
JavaScript

import Ember from 'ember';
import ENV from '../config/environment';
export default Ember.Route.extend({
model() {
return this.store.query('entity', { entities: [
{
id: 'S1_ElectricalGrid',
isPattern: false,
type: ''
},
{
id: 'S2_ElectricalGrid',
isPattern: false,
type: ''
},
{
id: 'S3_ElectricalGrid',
isPattern: false,
type: ''
}
]});
//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: 'S1_ElectricalGrid',
isPattern: false,
type: ''
},
{
id: 'S2_ElectricalGrid',
isPattern: false,
type: ''
},
{
id: 'S3_ElectricalGrid',
isPattern: false,
type: ''
}
]});
//this.store.findAll('entity');
// reschedule refresh
Ember.run.later(this, function() {
this.refreshEntities();
}, ENV.APP.UPDATE_RATE);
}
});