2019-12-17 18:47:37 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-11-09 09:25:35 +00:00
|
|
|
import Route from 'consul-ui/routing/route';
|
2019-12-17 18:47:37 +00:00
|
|
|
|
|
|
|
import WithNspaceActions from 'consul-ui/mixins/nspace/with-actions';
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class IndexRoute extends Route.extend(WithNspaceActions) {
|
2020-11-13 15:55:40 +00:00
|
|
|
@service('data-source/service') data;
|
|
|
|
@service('repository/nspace') repo;
|
2020-11-09 09:25:35 +00:00
|
|
|
|
|
|
|
queryParams = {
|
2020-08-10 14:54:51 +00:00
|
|
|
sortBy: 'sort',
|
2020-12-01 15:45:09 +00:00
|
|
|
searchproperty: {
|
|
|
|
as: 'searchproperty',
|
|
|
|
empty: [['Name', 'Description', 'Role', 'Policy']],
|
|
|
|
},
|
2020-05-29 15:42:46 +00:00
|
|
|
search: {
|
2019-12-17 18:47:37 +00:00
|
|
|
as: 'filter',
|
|
|
|
replace: true,
|
|
|
|
},
|
2020-11-09 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
2021-01-25 18:13:54 +00:00
|
|
|
async model(params) {
|
|
|
|
return {
|
|
|
|
items: await this.data.source(uri => uri`/*/*/namespaces`),
|
|
|
|
searchProperties: this.queryParams.searchproperty.empty[0],
|
|
|
|
};
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
super.setupController(...arguments);
|
2019-12-17 18:47:37 +00:00
|
|
|
controller.setProperties(model);
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|