mirror of https://github.com/hashicorp/consul
32 lines
746 B
JavaScript
32 lines
746 B
JavaScript
import { computed } from '@ember/object';
|
|
import Controller from '@ember/controller';
|
|
|
|
export default class IndexController extends Controller {
|
|
queryParams = {
|
|
sortBy: 'sort',
|
|
status: 'status',
|
|
source: 'source',
|
|
kind: 'kind',
|
|
search: {
|
|
as: 'filter',
|
|
replace: true,
|
|
},
|
|
};
|
|
|
|
@computed('items.[]')
|
|
get services() {
|
|
return this.items.filter(function(item) {
|
|
return item.Kind !== 'connect-proxy';
|
|
});
|
|
}
|
|
|
|
@computed('services')
|
|
get externalSources() {
|
|
const sources = this.services.reduce(function(prev, item) {
|
|
return prev.concat(item.ExternalSources || []);
|
|
}, []);
|
|
// unique, non-empty values, alpha sort
|
|
return [...new Set(sources)].filter(Boolean).sort();
|
|
}
|
|
}
|