import { UISref, UISrefActive } from '@uirouter/react'; import { orderBy } from 'lodash'; import React from 'react'; import { HealthCounts, LoadBalancerInstances, LoadBalancerServerGroup } from '@spinnaker/core'; import type { IAmazonApplicationLoadBalancer, ITargetGroup } from '../domain/IAmazonLoadBalancer'; import './targetGroup.less'; export interface ITargetGroupProps { loadBalancer: IAmazonApplicationLoadBalancer; targetGroup: ITargetGroup; showServerGroups: boolean; showInstances: boolean; } export class TargetGroup extends React.Component { public render(): React.ReactElement { const { targetGroup, showInstances, showServerGroups, loadBalancer } = this.props; const ServerGroups = orderBy( targetGroup.serverGroups, ['isDisabled', 'name'], ['asc', 'desc'], ).map((serverGroup) => ( )); const params = { loadBalancerName: loadBalancer.name, region: targetGroup.region, accountId: targetGroup.account, name: targetGroup.name, vpcId: targetGroup.vpcId, provider: targetGroup.cloudProvider, }; return (
{targetGroup.name}
{showServerGroups && ServerGroups} {!showServerGroups && showInstances && ( )}
); } }