From 33cb865a57ad55b25da9562789dfdf0795ace00b Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 20 Jul 2017 12:45:11 +0900 Subject: [PATCH] =?UTF-8?q?=E3=85=87tslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/components/DiscoveryDetails.tsx | 48 ++++++++++--------- .../temp/react/components/DiscoveryProbe.tsx | 30 ++++++++---- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx index 76867bf..3634e08 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx @@ -15,12 +15,32 @@ export interface Props { export interface State { startPopup:boolean; + probeTemp: Object; } +const probeTemp:Object = { + 'id': '11', + 'metaProbeStatus': { + 'name': 'STARTED', + }, + 'domain': { + 'name': 'overFlow\'s domain111', + }, + 'host': { + 'ip': '192.168.1.103', + 'mac': '44:8a:5b:44:8c:e8', + 'os': 'Ubuntu 17.04', + 'name': '?????', + }, + 'createAt': '2017-07-12', + 'probeKey': 'AGBLKDFJ2452ASDGFL2KWJLKSDJ', + 'description': 'description1111111111', + 'lastPollingAt': '2017-07-12 14:20', + 'nextPollingAt': '2017-07-12 14:30', +}; export class DiscoveryDetails extends React.Component { - private probeTemp: any; private submitData: any; public constructor(props: Props, context: State) { @@ -28,35 +48,17 @@ export class DiscoveryDetails extends React.Component { this.handleProbeChange.bind(this); this.state = { startPopup:false, + probeTemp:probeTemp, }; } public componentWillMount():void { super.componentWillMount(); - this.probeTemp = { - 'id': '11', - 'metaProbeStatus': { - 'name': 'STARTED', - }, - 'domain': { - 'name': 'overFlow\'s domain111', - }, - 'host': { - 'ip': '192.168.1.103', - 'mac': '44:8a:5b:44:8c:e8', - 'os': 'Ubuntu 17.04', - 'name': '?????', - }, - 'createAt': '2017-07-12', - 'probeKey': 'AGBLKDFJ2452ASDGFL2KWJLKSDJ', - 'description': 'description1111111111', - 'lastPollingAt': '2017-07-12 14:20', - 'nextPollingAt': '2017-07-12 14:30', - }; + } - public handleProbeChange(obj: any): void { + public handleProbeChange(obj: Object): void { console.log(obj); this.setState({ startPopup:true }); this.submitData = obj; @@ -74,7 +76,7 @@ export class DiscoveryDetails extends React.Component { return (
Discovery Details
- +
diff --git a/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx b/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx index e2b0035..c61c7bf 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx @@ -1,23 +1,37 @@ import * as React from 'react'; -import { Table, Label, Header, Container, Icon } from 'semantic-ui-react'; +import { + Table, + Label, + Header, + Container, + Icon, +} from 'semantic-ui-react'; +export interface Props { + probe: Object; + onProbeChange():void; +} -export class DiscoveryProbe extends React.Component { +export interface State { +} - constructor(props: any, context: any) { +export class DiscoveryProbe extends React.Component { + + constructor(props: Props, context: State) { super(props, context); this.state = {}; } - // componentWillMount() { - // console.log(this.props.probe); - // } + public componentWillMount():void { + super.componentWillMount(); + console.log(this.props.probe); + } - handle() { + public handle():void { this.props.onProbeChange(); } - render() { + public render(): JSX.Element { return (
Probe