ㅇtslint

This commit is contained in:
geek 2017-07-20 13:30:15 +09:00
parent fdf176d745
commit 35acbdb599
3 changed files with 37 additions and 13 deletions

View File

@ -15,7 +15,7 @@ export interface Props {
export interface State { export interface State {
startPopup:boolean; startPopup:boolean;
probeTemp: Object; probeTemp: any;
} }
const probeTemp:Object = { const probeTemp:Object = {

View File

@ -6,10 +6,11 @@ import {
Container, Container,
Icon, Icon,
} from 'semantic-ui-react'; } from 'semantic-ui-react';
import {object} from 'prop-types';
export interface Props { export interface Props {
probe: Object; probe?: any;
onProbeChange():void; onProbeChange?:((obj:object) => void);
} }
export interface State { export interface State {
@ -28,7 +29,7 @@ export class DiscoveryProbe extends React.Component<Props, State> {
} }
public handle():void { public handle():void {
this.props.onProbeChange(); this.props.onProbeChange(this.state);
} }
public render(): JSX.Element { public render(): JSX.Element {

View File

@ -1,22 +1,45 @@
import * as React from 'react'; 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<any, any> {
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<Props, State> {
private serviceTemp: any; private serviceTemp: any;
constructor(props: any, context: any) { constructor(props: Props, context: State) {
super(props, context); super(props, context);
this.state = { this.state = {
startIp: null, startIp: null,
endIP: null, endIP: null,
excludeIp: null, excludeIp: null,
startPort: null, startPort: null,
endPort: null endPort: null,
}; };
} }
componentWillMount() { public componentWillMount():void {
super.componentWillMount();
this.serviceTemp = [ this.serviceTemp = [
{ key: 'http', text: 'HTTP', value: 'http' }, { key: 'http', text: 'HTTP', value: 'http' },
{ key: 'ftp', text: 'FTP', value: 'ftp' }, { key: 'ftp', text: 'FTP', value: 'ftp' },
@ -35,7 +58,7 @@ export class DiscoveryTable extends React.Component<any, any> {
]; ];
} }
handleInput(event: React.SyntheticEvent<HTMLInputElement>, data: InputProps) { public handleInput(event: React.SyntheticEvent<HTMLInputElement>, data: InputProps):void {
// console.log( data.value); // console.log( data.value);
// console.log( event.target); // console.log( event.target);
// console.log(data.tabIndex); // console.log(data.tabIndex);
@ -73,7 +96,7 @@ export class DiscoveryTable extends React.Component<any, any> {
break; break;
} }
default:{ default:{
console.log("Error"); console.log('Error');
break; break;
} }
} }
@ -81,11 +104,11 @@ export class DiscoveryTable extends React.Component<any, any> {
console.log(this.state.startPort); console.log(this.state.startPort);
} }
discoveryStartHandler(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps) { public discoveryStartHandler(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps): void {
this.props.onProbeChange(this.state); this.props.onProbeChange(this.state);
} }
render() { public render(): JSX.Element {
return ( return (
<Container fluid> <Container fluid>
<Header as='h4' color='grey'> Discovery</Header> <Header as='h4' color='grey'> Discovery</Header>