From 35acbdb599473102e79aede7858a4b866a7cf014 Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 20 Jul 2017 13:30:15 +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 | 2 +- .../temp/react/components/DiscoveryProbe.tsx | 7 ++-- .../temp/react/components/DiscoveryTable.tsx | 41 +++++++++++++++---- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx index 3634e08..c5df4f5 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx @@ -15,7 +15,7 @@ export interface Props { export interface State { startPopup:boolean; - probeTemp: Object; + probeTemp: any; } const probeTemp:Object = { diff --git a/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx b/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx index c61c7bf..93dae9d 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryProbe.tsx @@ -6,10 +6,11 @@ import { Container, Icon, } from 'semantic-ui-react'; +import {object} from 'prop-types'; export interface Props { - probe: Object; - onProbeChange():void; + probe?: any; + onProbeChange?:((obj:object) => void); } export interface State { @@ -28,7 +29,7 @@ export class DiscoveryProbe extends React.Component { } public handle():void { - this.props.onProbeChange(); + this.props.onProbeChange(this.state); } public render(): JSX.Element { diff --git a/src/ts/@overflow/temp/react/components/DiscoveryTable.tsx b/src/ts/@overflow/temp/react/components/DiscoveryTable.tsx index 220abb4..de2edf4 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryTable.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryTable.tsx @@ -1,22 +1,45 @@ import * as React from 'react'; -import {Table, Button, Input, InputProps, ButtonProps, Dropdown, Container, Header } from 'semantic-ui-react'; +import { + Table, + Button, + Input, + InputProps, + ButtonProps, + Dropdown, + Container, + Header, +} from 'semantic-ui-react'; -export class DiscoveryTable extends React.Component { + +export interface Props { + onProbeChange?(state:object):void; +} + +export interface State { + startIp: string; + endIP: string; + excludeIp: string; + startPort: string; + endPort: string; +} + +export class DiscoveryTable extends React.Component { private serviceTemp: any; - constructor(props: any, context: any) { + constructor(props: Props, context: State) { super(props, context); this.state = { startIp: null, endIP: null, excludeIp: null, startPort: null, - endPort: null + endPort: null, }; } - componentWillMount() { + public componentWillMount():void { + super.componentWillMount(); this.serviceTemp = [ { key: 'http', text: 'HTTP', value: 'http' }, { key: 'ftp', text: 'FTP', value: 'ftp' }, @@ -35,7 +58,7 @@ export class DiscoveryTable extends React.Component { ]; } - handleInput(event: React.SyntheticEvent, data: InputProps) { + public handleInput(event: React.SyntheticEvent, data: InputProps):void { // console.log( data.value); // console.log( event.target); // console.log(data.tabIndex); @@ -73,7 +96,7 @@ export class DiscoveryTable extends React.Component { break; } default:{ - console.log("Error"); + console.log('Error'); break; } } @@ -81,11 +104,11 @@ export class DiscoveryTable extends React.Component { console.log(this.state.startPort); } - discoveryStartHandler(event: React.SyntheticEvent, data: ButtonProps) { + public discoveryStartHandler(event: React.SyntheticEvent, data: ButtonProps): void { this.props.onProbeChange(this.state); } - render() { + public render(): JSX.Element { return (
Discovery