mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-23 00:00:02 +01:00
48 lines
946 B
JavaScript
48 lines
946 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Route.extend({
|
|
model() {
|
|
return this.store.query('entity', { entities: [
|
|
{
|
|
id: 'S1_ElectricalGrid',
|
|
isPattern: false,
|
|
type: ''
|
|
},
|
|
{
|
|
id: 'DataFileControl',
|
|
isPattern: false,
|
|
type: 'DataFileControl'
|
|
}
|
|
]});
|
|
//return this.store.findAll('entity');
|
|
},
|
|
|
|
afterModel() {
|
|
// first time call poll
|
|
Ember.run.later(this, function() {
|
|
this.refreshEntities();
|
|
}, 100);
|
|
},
|
|
|
|
refreshEntities: function() {
|
|
// fetch new data from server
|
|
this.store.query('entity', { entities: [
|
|
{
|
|
id: 'S1_ElectricalGrid',
|
|
isPattern: false,
|
|
type: ''
|
|
},
|
|
{
|
|
id: 'DataFileControl',
|
|
isPattern: false,
|
|
type: 'DataFileControl'
|
|
}
|
|
]});
|
|
//this.store.findAll('entity');
|
|
|
|
// reschedule refresh
|
|
Ember.run.later(this, function() {
|
|
this.refreshEntities();
|
|
}, 100);
|
|
}
|
|
});
|