import React from 'react'; import { CollapsibleSection, LabeledValue, LabeledValueList, Overridable } from '@spinnaker/core'; export interface IIPRangeRulesProps { ipRules: IIPRangeRulesDetails[]; } export interface IIPRangeRulesDetails { rules: IRangeRule[]; address: string; } export interface IRangeRule { startPort: number; endPort: number; protocol: string; description: string; } @Overridable('aws.securityGroup.ip.rules') export class IPRangeRules extends React.Component { public render() { const ipRules = this.props.ipRules || []; const heading = `IP Range Rules (${ipRules.length})`; return ( {ipRules.map((rule) => ( r.protocol === '-1' ? ( All ports and protocols {rule.rules.length > 1 ? (
Additional port ranges are specified, but redundant:
) : null}
) : (
{r.protocol}:{r.startPort} → {r.endPort}
), )} />
))}
); } }