Skip to content

Commit

Permalink
~ hide on icmp (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldsce authored Mar 30, 2022
1 parent 6dc1dd4 commit 87b6435
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/main/policies/trustPolicyException/Reg.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ class TrustPolicyExceptionReg extends React.Component {
let requiredOutboundConnections = data[localFields.requiredOutboundConnections]
for (const requiredOutboundConnection of requiredOutboundConnections) {
let outboundConnectionsForms = this.outboundConnectionsForm()
let isNotICMP = requiredOutboundConnection['protocol'] !== perpetual.PROTOCOL_ICMP
for (let outboundConnectionsForm of outboundConnectionsForms) {
if (outboundConnectionsForm.field === localFields.ocProtocol) {
outboundConnectionsForm.value = requiredOutboundConnection['protocol']
Expand All @@ -360,13 +361,16 @@ class TrustPolicyExceptionReg extends React.Component {
outboundConnectionsForm.value = requiredOutboundConnection['remote_cidr']
}
else if (outboundConnectionsForm.field === localFields.ocPortMin) {
outboundConnectionsForm.visible = requiredOutboundConnection['protocol'] !== perpetual.PROTOCOL_ICMP
outboundConnectionsForm.visible = isNotICMP
outboundConnectionsForm.value = requiredOutboundConnection['port_range_min']
}
else if (outboundConnectionsForm.field === localFields.ocPortMax) {
outboundConnectionsForm.visible = requiredOutboundConnection['protocol'] !== perpetual.PROTOCOL_ICMP
outboundConnectionsForm.visible = isNotICMP
outboundConnectionsForm.value = requiredOutboundConnection['port_range_max']
}
else if (outboundConnectionsForm.icon ==='~') {
outboundConnectionsForm.visible = isNotICMP
}
}
forms.splice(19 + multiFormCount, 0, this.getOutboundConnectionsForm(outboundConnectionsForms))
multiFormCount += 1
Expand Down

0 comments on commit 87b6435

Please sign in to comment.