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