2022-10-11 09:24:10 +00:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
|
|
|
|
export default class ConsulServiceSearchBar extends Component {
|
|
|
|
get healthStates() {
|
|
|
|
if (this.args.peer) {
|
2022-10-11 11:13:43 +00:00
|
|
|
return ['passing', 'warning', 'critical', 'unknown', 'empty'];
|
|
|
|
} else {
|
|
|
|
return ['passing', 'warning', 'critical', 'empty'];
|
2022-10-11 09:24:10 +00:00
|
|
|
}
|
|
|
|
}
|
2022-10-13 14:03:03 +00:00
|
|
|
|
|
|
|
get sortedSources() {
|
|
|
|
const sources = this.args.sources || [];
|
2022-10-25 17:12:15 +00:00
|
|
|
sources.unshift(['consul']);
|
2022-10-13 14:03:03 +00:00
|
|
|
|
|
|
|
if (sources.includes('consul-api-gateway')) {
|
|
|
|
return [...sources.filter((s) => s !== 'consul-api-gateway'), 'consul-api-gateway'];
|
|
|
|
} else {
|
|
|
|
return sources;
|
|
|
|
}
|
|
|
|
}
|
2022-10-11 09:24:10 +00:00
|
|
|
}
|