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() {
|
2022-07-13 11:06:16 +00:00
|
|
|
return ![
|
|
|
|
'DELETING',
|
|
|
|
'TERMINATED'
|
|
|
|
].includes(this.item.State) && super.canDelete;
|
2022-07-04 10:31:58 +00:00
|
|
|
}
|
|
|
|
|
2022-07-12 11:02:45 +00:00
|
|
|
get canUse() {
|
2022-07-14 10:22:45 +00:00
|
|
|
return this.env.var('CONSUL_PEERINGS_ENABLED');
|
2022-07-12 11:02:45 +00:00
|
|
|
}
|
2022-07-04 10:31:58 +00:00
|
|
|
}
|