2018-10-19 15:17:02 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-11-09 09:25:35 +00:00
|
|
|
import Route from 'consul-ui/routing/route';
|
2018-10-19 15:17:02 +00:00
|
|
|
import { hash } from 'rsvp';
|
|
|
|
|
|
|
|
import WithPolicyActions from 'consul-ui/mixins/policy/with-actions';
|
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class IndexRoute extends Route.extend(WithPolicyActions) {
|
2020-11-13 15:55:40 +00:00
|
|
|
@service('repository/policy') repo;
|
2020-11-09 09:25:35 +00:00
|
|
|
|
|
|
|
queryParams = {
|
2020-07-29 18:36:09 +00:00
|
|
|
sortBy: 'sort',
|
2020-11-13 15:55:40 +00:00
|
|
|
dc: 'dc',
|
|
|
|
kind: 'kind',
|
2020-05-29 15:42:46 +00:00
|
|
|
search: {
|
2018-10-19 15:17:02 +00:00
|
|
|
as: 'filter',
|
|
|
|
replace: true,
|
|
|
|
},
|
2020-11-09 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
model(params) {
|
2018-10-19 15:17:02 +00:00
|
|
|
return hash({
|
2019-12-17 18:47:37 +00:00
|
|
|
...this.repo.status({
|
|
|
|
items: this.repo.findAllByDatacenter(
|
|
|
|
this.modelFor('dc').dc.Name,
|
|
|
|
this.modelFor('nspace').nspace.substr(1)
|
|
|
|
),
|
2018-10-19 15:17:02 +00:00
|
|
|
}),
|
|
|
|
});
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
super.setupController(...arguments);
|
2018-10-19 15:17:02 +00:00
|
|
|
controller.setProperties(model);
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|