mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 02:48:19 +00:00
Adds a 'status' for the filtering/searching in the UI, without this its not super clear that you are filtering a recordset due to the menu selections being hidden once closed. You can also use the pills in this status view to delete individual filters.
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
import { inject as service } from '@ember/service';
|
|
import Route from 'consul-ui/routing/route';
|
|
|
|
export default class ServicesRoute extends Route {
|
|
@service('data-source/service') data;
|
|
|
|
queryParams = {
|
|
sortBy: 'sort',
|
|
instance: 'instance',
|
|
searchproperty: {
|
|
as: 'searchproperty',
|
|
empty: [['Name', 'Tags']],
|
|
},
|
|
search: {
|
|
as: 'filter',
|
|
replace: true,
|
|
},
|
|
};
|
|
|
|
async model(params, transition) {
|
|
const dc = this.modelFor('dc').dc.Name;
|
|
const nspace = this.modelFor('nspace').nspace.substr(1);
|
|
const parent = this.routeName
|
|
.split('.')
|
|
.slice(0, -1)
|
|
.join('.');
|
|
const name = this.modelFor(parent).slug;
|
|
const items = await this.data.source(uri => uri`/${nspace}/${dc}/gateways/for-service/${name}`);
|
|
return {
|
|
dc,
|
|
nspace,
|
|
items,
|
|
searchProperties: this.queryParams.searchproperty.empty[0],
|
|
};
|
|
}
|
|
|
|
setupController(controller, model) {
|
|
super.setupController(...arguments);
|
|
controller.setProperties(model);
|
|
}
|
|
}
|