diff --git a/src/ts/containers/test/ProbeDetails.tsx b/src/ts/containers/test/ProbeDetails.tsx index eb62e68..ac88c68 100644 --- a/src/ts/containers/test/ProbeDetails.tsx +++ b/src/ts/containers/test/ProbeDetails.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { Button, Table, Label, Segment, Header } from 'semantic-ui-react'; import { TargetTable } from './Targets'; +import { DetailContainer } from './commons/DetailContainer'; export class ProbeDetails extends React.Component { @@ -14,6 +15,25 @@ export class ProbeDetails extends React.Component { } + render() { + const items = [ + { name: 'Info', child: }, + { name: 'Targets', child: }, + ]; + return ( + + ); + } +} + +export class ProbeBasicInfo extends React.Component { + + constructor(props: any, context: any) { + super(props, context); + this.state = { + }; + } + handleStartStop(event: any, data: any) { console.log(event); } @@ -22,7 +42,7 @@ export class ProbeDetails extends React.Component { } handleBack(event: any, data: any) { - console.log(data); + this.props.onBack(); } @@ -35,82 +55,63 @@ export class ProbeDetails extends React.Component { } render() { - let elem: any; - if (this.props.probe === null) { - elem =
; - } else { - elem = - - -

Probe Details

-
- - - - - -
Domain
-
- {this.props.probe.domain.name} -
- - -
Status
-
- {this.props.probe.metaProbeStatus.name} -
- - -
Host IP
-
- ???? -
- - -
Host Name
-
- ???? -
- - -
Authorized at
-
- {this.props.probe.createDate} -
- - -
Description
-
- {this.props.probe.description} -
- - - -
-
- - -

Probe's Targets

-
- - - -
; - } return ( -
- {elem} -
+ + +

Probe Details

+
+ + + + + +
Domain
+
+ {this.props.probe.domain.name} +
+ + +
Status
+
+ {this.props.probe.metaProbeStatus.name} +
+ + +
Host IP
+
+ ???? +
+ + +
Host Name
+
+ ???? +
+ + +
Authorized at
+
+ {this.props.probe.createDate} +
+ + +
Description
+
+ {this.props.probe.description} +
+ + + +
+
+
); } -} - - - +} \ No newline at end of file diff --git a/src/ts/containers/test/Probes.tsx b/src/ts/containers/test/Probes.tsx index ce051aa..ac3b12b 100644 --- a/src/ts/containers/test/Probes.tsx +++ b/src/ts/containers/test/Probes.tsx @@ -11,6 +11,7 @@ export class Probes extends React.Component { super(props, context); this.state = { selected: null, + isDetail: false, }; } @@ -64,7 +65,7 @@ export class Probes extends React.Component { } checkCellStatus(status: any): boolean { - if(status.name === 'STOPPED') { + if (status.name === 'STOPPED') { return true; } return false; @@ -73,40 +74,39 @@ export class Probes extends React.Component { handleSelect(selectedProbe: object) { this.setState({ selected: selectedProbe, + isDetail: true, }); } render() { + if (this.state.isDetail) { + return this.setState({isDetail:false})}/>; + } return ( -
- - - - Name - CIDR - Status - Target Count - Sensor Count - - +
+ + + Name + CIDR + Status + Target Count + Sensor Count + + - - {this.data.map((probe: any, index: number) => ( - - todo. {probe.name} - todo. {probe.cidr} - {probe.metaProbeStatus.name} - todo. {probe.targetCnt} - todo. {probe.sensorCnt} - - ))} - -
-
- -
-
+ + {this.data.map((probe: any, index: number) => ( + + todo. {probe.name} + todo. {probe.cidr} + {probe.metaProbeStatus.name} + todo. {probe.targetCnt} + todo. {probe.sensorCnt} + + ))} + + ); } } diff --git a/src/ts/containers/test/commons/DetailContainer.tsx b/src/ts/containers/test/commons/DetailContainer.tsx new file mode 100644 index 0000000..50c6b16 --- /dev/null +++ b/src/ts/containers/test/commons/DetailContainer.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import { Grid, Menu, Segment } from 'semantic-ui-react'; + +export class DetailContainer extends React.Component { + + constructor(props: any, context: any) { + super(props, context); + this.state = { + active: 0, + }; + } + + showContents() { + return this.props.panes[this.state.active].child; + } + + handleClick(index: number) { + this.setState({ + active: index, + }); + } + + render() { + const activeItem = this.state.activeItem; + + return ( + + + + {this.props.panes.map((pane: any, index: number) => ( + + ))} + + + + + + {this.showContents()} + + + + ); + } +} \ No newline at end of file