-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cf): separate SG details sections (#6291)
Co-Authored-By: Jammy Louie <jlouie@pivotal.io>
- Loading branch information
1 parent
2c3e5df
commit 16fd07d
Showing
13 changed files
with
301 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ripts/modules/cloudfoundry/src/serverGroup/details/sections/ApplicationManagerSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class ApplicationManagerSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<> | ||
{serverGroup.appsManagerUri && ( | ||
<CollapsibleSection heading="Apps Manager" defaultExpanded={true}> | ||
<div> | ||
<a href={serverGroup.appsManagerUri} target="_blank"> | ||
Apps Manager | ||
</a> | ||
</div> | ||
</CollapsibleSection> | ||
)} | ||
</> | ||
); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
app/scripts/modules/cloudfoundry/src/serverGroup/details/sections/BoundServicesSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as React from 'react'; | ||
|
||
import { isEmpty } from 'lodash'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryServiceInstance } from 'cloudfoundry/domain'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class BoundServicesSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<> | ||
{!isEmpty(serverGroup.serviceInstances) && ( | ||
<CollapsibleSection heading="Bound Services" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
{serverGroup.serviceInstances.map(function(service: ICloudFoundryServiceInstance, index: number) { | ||
return ( | ||
<div key={index}> | ||
<dt>Name</dt> | ||
<dd>{service.name}</dd> | ||
<dt>Plan</dt> | ||
<dd>{service.plan}</dd> | ||
<dt>Tags</dt> | ||
{service.tags && <dd>{service.tags.join(', ')}</dd>} | ||
</div> | ||
); | ||
})} | ||
</dl> | ||
</CollapsibleSection> | ||
)} | ||
</> | ||
); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ipts/modules/cloudfoundry/src/serverGroup/details/sections/EvironmentVariablesSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
|
||
import { isEmpty, map } from 'lodash'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryEnvVar } from 'cloudfoundry/domain'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class EvironmentVariablesSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<> | ||
{!isEmpty(serverGroup.env) && ( | ||
<CollapsibleSection heading="Environment Variables" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
{map(serverGroup.env, (obj: ICloudFoundryEnvVar, index: number) => { | ||
return ( | ||
<div key={index}> | ||
<dt>{obj.key}</dt> | ||
<dd>{obj.value}</dd> | ||
</div> | ||
); | ||
})} | ||
</dl> | ||
</CollapsibleSection> | ||
)} | ||
</> | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/scripts/modules/cloudfoundry/src/serverGroup/details/sections/HealthCheckSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from 'react'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class HealthCheckSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<CollapsibleSection heading="Health Check" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
<dt>Type</dt> | ||
<dd>{serverGroup.healthCheckType === undefined ? 'port' : serverGroup.healthCheckType}</dd> | ||
{serverGroup.healthCheckType === 'http' && ( | ||
<div> | ||
<dt>Endpoint</dt> | ||
<dd>{serverGroup.healthCheckHttpEndpoint}</dd> | ||
</div> | ||
)} | ||
</dl> | ||
</CollapsibleSection> | ||
); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...udfoundry/src/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IServerGroupDetailsSectionProps } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryServerGroup } from 'cloudfoundry/domain'; | ||
|
||
export interface ICloudFoundryServerGroupDetailsSectionProps extends IServerGroupDetailsSectionProps { | ||
serverGroup: ICloudFoundryServerGroup; | ||
} |
27 changes: 27 additions & 0 deletions
27
app/scripts/modules/cloudfoundry/src/serverGroup/details/sections/MetricsSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class MetricsSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<> | ||
{serverGroup.metricsUri && ( | ||
<CollapsibleSection heading="Metrics" defaultExpanded={true}> | ||
<div> | ||
<a href={serverGroup.metricsUri} target="_blank"> | ||
Metrics | ||
</a> | ||
</div> | ||
</CollapsibleSection> | ||
)} | ||
</> | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/scripts/modules/cloudfoundry/src/serverGroup/details/sections/PackageSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from 'react'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class PackageSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<> | ||
{serverGroup.droplet && | ||
serverGroup.droplet.sourcePackage && ( | ||
<CollapsibleSection heading="Package" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
<dt>Checksum</dt> | ||
<dd>{serverGroup.droplet.sourcePackage.checksum}</dd> | ||
</dl> | ||
</CollapsibleSection> | ||
)} | ||
</> | ||
); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...s/modules/cloudfoundry/src/serverGroup/details/sections/ServerGroupInformationSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import * as React from 'react'; | ||
|
||
import { AccountTag, CollapsibleSection, timestamp } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryBuildpack } from 'cloudfoundry/domain'; | ||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class ServerGroupInformationSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<CollapsibleSection heading="Server Group Information" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
<dt>Created</dt> | ||
<dd>{timestamp(serverGroup.createdTime)}</dd> | ||
<dt>Account</dt> | ||
<dd> | ||
<AccountTag account={serverGroup.account} /> | ||
</dd> | ||
<dt>Organization</dt> | ||
<dd>{serverGroup.space.organization.name}</dd> | ||
<dt>Space</dt> | ||
<dd>{serverGroup.space.name}</dd> | ||
{serverGroup.droplet && ( | ||
<div> | ||
<dt>Rootfs</dt> | ||
<dd>{serverGroup.droplet.stack}</dd> | ||
<dt>Buildpack</dt> | ||
{serverGroup.droplet.buildpacks ? ( | ||
serverGroup.droplet.buildpacks.map(function(buildpack: ICloudFoundryBuildpack, index: number) { | ||
return ( | ||
<dd key={index}> | ||
{buildpack.name} {buildpack.version} | ||
</dd> | ||
); | ||
}) | ||
) : ( | ||
<dd>n/a</dd> | ||
)} | ||
</div> | ||
)} | ||
</dl> | ||
</CollapsibleSection> | ||
); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...cripts/modules/cloudfoundry/src/serverGroup/details/sections/ServerGroupSizingSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
|
||
import { CollapsibleSection } from '@spinnaker/core'; | ||
|
||
import { ICloudFoundryServerGroupDetailsSectionProps } from './ICloudFoundryServerGroupDetailsSectionProps'; | ||
|
||
export class ServerGroupSizingSection extends React.Component<ICloudFoundryServerGroupDetailsSectionProps> { | ||
constructor(props: ICloudFoundryServerGroupDetailsSectionProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
const { serverGroup } = this.props; | ||
return ( | ||
<CollapsibleSection heading="Server Group Sizing" defaultExpanded={true}> | ||
<dl className="dl-horizontal dl-flex"> | ||
<dt>Instances</dt> | ||
<dd>{serverGroup.instances.length}</dd> | ||
<dt>Disk Mb</dt> | ||
<dd>{serverGroup.diskQuota}</dd> | ||
<dt>Memory Mb</dt> | ||
<dd>{serverGroup.memory}</dd> | ||
</dl> | ||
</CollapsibleSection> | ||
); | ||
} | ||
} |
Oops, something went wrong.