2022-07-04 10:31:58 +00:00
|
|
|
import BaseAbility from 'consul-ui/abilities/base';
|
2022-07-12 11:02:45 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2022-07-04 10:31:58 +00:00
|
|
|
|
|
|
|
export default class PeerAbility extends BaseAbility {
|
2022-07-12 11:02:45 +00:00
|
|
|
@service('env') env;
|
|
|
|
|
2022-07-12 15:16:47 +00:00
|
|
|
resource = 'peering';
|
2022-07-04 10:31:58 +00:00
|
|
|
segmented = false;
|
|
|
|
|
|
|
|
get isLinkable() {
|
|
|
|
return this.canDelete;
|
|
|
|
}
|
|
|
|
get canDelete() {
|
|
|
|
// TODO: Need to confirm these states
|
2022-07-12 15:16:47 +00:00
|
|
|
return !['DELETING', 'TERMINATED', 'UNDEFINED'].includes(this.item.State) && super.canDelete;
|
2022-07-04 10:31:58 +00:00
|
|
|
}
|
|
|
|
|
2022-07-12 11:02:45 +00:00
|
|
|
get canUse() {
|
|
|
|
return this.env.var('CONSUL_PEERING_ENABLED');
|
|
|
|
}
|
2022-07-04 10:31:58 +00:00
|
|
|
}
|