From cda2703139b79e7f68ab28b4caa920acfc193a4e Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 26 Jul 2017 15:23:14 +0900 Subject: [PATCH] target --- .../target/react/components/TargetDetail.tsx | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/src/ts/@overflow/target/react/components/TargetDetail.tsx b/src/ts/@overflow/target/react/components/TargetDetail.tsx index d5d3f6c..d219059 100644 --- a/src/ts/@overflow/target/react/components/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/components/TargetDetail.tsx @@ -20,6 +20,7 @@ export type Props = StateProps & DispatchProps; export interface State { selected: Probe; + targetTemp: any; isDetail: boolean; list: Probe[]; } @@ -31,11 +32,38 @@ export class TargetDetail extends React.Component { super(props, context); this.state = { selected: null, + targetTemp: null, isDetail: false, list: null, }; } + public componentWillMount(): void { + let data = { + 'id': '1', + 'probe': { + 'id': '1', + 'status': { + 'id': '1', + 'name': 'INITIAL', + }, + 'description': 'snoop probe', + 'domain': { + 'id': '1', + 'name': 'overFlow`s domain', + }, + }, + 'infra': { + 'id': '1', + 'type': { + 'id': '1', + 'name': 'MACHINE', + }, + }, + }; + + this.setState({targetTemp: data}); + } public handleBack(): void { console.log('handleBack'); } @@ -51,13 +79,13 @@ export class TargetDetail extends React.Component { } const items = [ - { name: 'Info', child: }, + { name: 'Info', child: }, { name: 'Sensors', child: }, ]; return ( - + ); @@ -66,7 +94,7 @@ export class TargetDetail extends React.Component { export interface TargetBasicInfoProps { - probe?: Probe; + target?: Target; } export interface TargetBasicInfoState { @@ -81,6 +109,7 @@ export class TargetBasicInfo extends React.ComponentName - ??? + {this.props.target.probe.domain.name} @@ -105,7 +134,7 @@ export class TargetBasicInfo extends React.ComponentType - ???? + {this.props.target.infra.type.name} @@ -114,7 +143,7 @@ export class TargetBasicInfo extends React.ComponentSensor count - ??? + 1 @@ -123,13 +152,20 @@ export class TargetBasicInfo extends React.ComponentCreated at - ??? + {this.props.target.createDate} + + + + + + + - + ); }