ㅇtslint

This commit is contained in:
geek 2017-07-20 12:45:11 +09:00
parent f01f185ed6
commit 33cb865a57
2 changed files with 47 additions and 31 deletions

View File

@ -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<Props, State> {
private probeTemp: any;
private submitData: any;
public constructor(props: Props, context: State) {
@ -28,35 +48,17 @@ export class DiscoveryDetails extends React.Component<Props, State> {
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<Props, State> {
return (
<Container fluid>
<Header as='h3' dividing> Discovery Details</Header>
<DiscoveryProbe probe={this.probeTemp}/>
<DiscoveryProbe probe={this.state.probeTemp}/>
<br />
<DiscoveryTable onProbeChange={this.handleProbeChange.bind(this)} />

View File

@ -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<any, any> {
export interface State {
}
constructor(props: any, context: any) {
export class DiscoveryProbe extends React.Component<Props, State> {
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 (
<Container fluid>
<Header as='h4' color='grey'> Probe</Header>