mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 23:05:28 +00:00
123047d5b5
* ui: use environment variable for feature flagging peers * Add documentation for `features`-service * Allow setting feature flag for peers via bookmarklet * don't use features service for flagging peers * add ability for checking if peers feature is enabled * Use abilities to conditionally use peers feature * Remove unused features service
22 lines
503 B
JavaScript
22 lines
503 B
JavaScript
import BaseAbility from 'consul-ui/abilities/base';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class PeerAbility extends BaseAbility {
|
|
@service('env') env;
|
|
|
|
resource = 'operator';
|
|
segmented = false;
|
|
|
|
get isLinkable() {
|
|
return this.canDelete;
|
|
}
|
|
get canDelete() {
|
|
// TODO: Need to confirm these states
|
|
return !['DELETING', 'TERMINATED', 'UNDEFINED'].includes(this.item.State);
|
|
}
|
|
|
|
get canUse() {
|
|
return this.env.var('CONSUL_PEERING_ENABLED');
|
|
}
|
|
}
|