consul/ui/packages/consul-ui/app/controllers/dc/services/show/instances.js

24 lines
580 B
JavaScript

import { computed } from '@ember/object';
import Controller from '@ember/controller';
export default class InstancesController extends Controller {
queryParams = {
sortBy: 'sort',
status: 'status',
source: 'source',
search: {
as: 'filter',
replace: true,
},
};
@computed('items')
get externalSources() {
const sources = this.items.reduce(function(prev, item) {
return prev.concat(item.ExternalSources || []);
}, []);
// unique, non-empty values, alpha sort
return [...new Set(sources)].filter(Boolean).sort();
}
}