c1cc51a057
This is no longer needed! https://guides.emberjs.com/release/upgrading/current-edition/native-classes/#toc_properties-and-fields
31 lines
740 B
JavaScript
31 lines
740 B
JavaScript
import { inject as service } from '@ember/service';
|
|
import Route from '@ember/routing/route';
|
|
import RSVP from 'rsvp';
|
|
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state';
|
|
import notifyForbidden from 'nomad-ui/utils/notify-forbidden';
|
|
import classic from 'ember-classic-decorator';
|
|
|
|
@classic
|
|
export default class ServersRoute extends Route.extend(WithForbiddenState) {
|
|
@service store;
|
|
@service system;
|
|
|
|
breadcrumbs = [
|
|
{
|
|
label: 'Servers',
|
|
args: ['servers.index'],
|
|
},
|
|
];
|
|
|
|
beforeModel() {
|
|
return this.get('system.leader');
|
|
}
|
|
|
|
model() {
|
|
return RSVP.hash({
|
|
nodes: this.store.findAll('node'),
|
|
agents: this.store.findAll('agent'),
|
|
}).catch(notifyForbidden(this));
|
|
}
|
|
}
|