mirror of https://github.com/hashicorp/consul
Browse Source
* Make nodes searchable by peer * fix only surface peer filter on service search when feature is onpull/13888/head
Michael Klein
2 years ago
committed by
GitHub
7 changed files with 28 additions and 5 deletions
@ -0,0 +1,16 @@
|
||||
import Controller from '@ember/controller'; |
||||
import { inject as service } from '@ember/service'; |
||||
|
||||
export default class PeeredResourceController extends Controller { |
||||
@service abilities; |
||||
|
||||
get _searchProperties() { |
||||
const { searchProperties } = this; |
||||
|
||||
if (!this.abilities.can('use peers')) { |
||||
return searchProperties.filter(propertyName => propertyName !== 'PeerName'); |
||||
} else { |
||||
return searchProperties; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,3 @@
|
||||
import PeeredResourceController from 'consul-ui/controllers/_peered-resource'; |
||||
|
||||
export default class DcNodesController extends PeeredResourceController {} |
@ -0,0 +1,3 @@
|
||||
import PeeredResourceController from 'consul-ui/controllers/_peered-resource'; |
||||
|
||||
export default class DcServicesController extends PeeredResourceController {} |
@ -1,5 +1,6 @@
|
||||
export default { |
||||
Node: item => item.Node, |
||||
Address: item => item.Address, |
||||
PeerName: item => item.PeerName, |
||||
Meta: item => Object.entries(item.Meta || {}).reduce((prev, entry) => prev.concat(entry), []), |
||||
}; |
||||
|
Loading…
Reference in new issue