2017-09-19 14:47:10 +00:00
|
|
|
import Ember from 'ember';
|
2017-10-24 23:07:43 +00:00
|
|
|
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state';
|
|
|
|
import notifyForbidden from 'nomad-ui/utils/notify-forbidden';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
const { Route, inject, RSVP } = Ember;
|
|
|
|
|
2017-10-24 23:07:43 +00:00
|
|
|
export default Route.extend(WithForbiddenState, {
|
2017-09-19 14:47:10 +00:00
|
|
|
store: inject.service(),
|
|
|
|
system: inject.service(),
|
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
return this.get('system.leader');
|
|
|
|
},
|
|
|
|
|
|
|
|
model() {
|
|
|
|
return RSVP.hash({
|
|
|
|
nodes: this.get('store').findAll('node'),
|
|
|
|
agents: this.get('store').findAll('agent'),
|
2017-10-24 23:07:43 +00:00
|
|
|
}).catch(notifyForbidden(this));
|
2017-09-19 14:47:10 +00:00
|
|
|
},
|
|
|
|
});
|