From 8cb5818b690788ae0a3183ce044ae5366026de72 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 20 Jul 2017 12:15:55 +0900 Subject: [PATCH] lint --- .../temp/react/components/NoauthProbes.tsx | 62 ++++---- .../temp/react/components/ProbeDetails.tsx | 28 ++-- .../react/components/ProbeDown.tsx | 0 .../temp/react/components/Probes.tsx | 137 ++++++++++-------- 4 files changed, 127 insertions(+), 100 deletions(-) rename src/ts/@overflow/{probe => temp}/react/components/ProbeDown.tsx (100%) diff --git a/src/ts/@overflow/temp/react/components/NoauthProbes.tsx b/src/ts/@overflow/temp/react/components/NoauthProbes.tsx index 24cd66c..ed5b1a5 100644 --- a/src/ts/@overflow/temp/react/components/NoauthProbes.tsx +++ b/src/ts/@overflow/temp/react/components/NoauthProbes.tsx @@ -1,6 +1,13 @@ import * as React from 'react'; import { Table, Checkbox, Button, Header, Container } from 'semantic-ui-react'; +export interface Props { + +} + +export interface State { + +} export class NoauthProbes extends React.Component { @@ -15,47 +22,46 @@ export class NoauthProbes extends React.Component { this.selectedIds = new Array(); } - - componentWillMount() { + public componentWillMount(): void { this.data = [ { - "id": "11", - "MetaNoAuthProbeStatus": { - "name": "NORMAL" + 'id': '11', + 'MetaNoAuthProbeStatus': { + 'name': 'NORMAL', }, - "hostName": "insanity's windows", - "macAddress": "14:fe:b5:9d:54:7e", - "ipAddress": "192.168.1.105", - "tempProbeKey": "45374d4egsdfw332", - "apiKey": "45374d4egsdfw332", - "domain": { + 'hostName': 'insanity windows', + 'macAddress': '14:fe:b5:9d:54:7e', + 'ipAddress': '192.168.1.105', + 'tempProbeKey': '45374d4egsdfw332', + 'apiKey': '45374d4egsdfw332', + 'domain': { }, - "probe": { + 'probe': { }, }, { - "id": "22", - "MetaNoAuthProbeStatus": { - "name": "NORMAL" + 'id': '22', + 'MetaNoAuthProbeStatus': { + 'name': 'NORMAL', }, - "hostName": "insanity's ubuntu", - "macAddress": "14:fe:b5:9d:54:7e", - "ipAddress": "192.168.1.105", - "tempProbeKey": "45374d4egsdfw332", - "apiKey": "45374d4egsdfw332", - "domain": { + 'hostName': 'insanity ubuntu', + 'macAddress': '14:fe:b5:9d:54:7e', + 'ipAddress': '192.168.1.105', + 'tempProbeKey': '45374d4egsdfw332', + 'apiKey': '45374d4egsdfw332', + 'domain': { }, - "probe": { + 'probe': { }, }, ]; } - handleSelect(id: string) { + public handleSelect(id: string): void { let idx = this.selectedIds.indexOf(id); if (idx === -1) { this.selectedIds.push(id); @@ -67,29 +73,29 @@ export class NoauthProbes extends React.Component { }); } - checkExist(id: string): boolean { + public checkExist(id: string): boolean { if (this.state.selected.indexOf(id) === -1) { return false; } return true; } - handleAccept() { + public handleAccept(): void { alert(this.state.selected); } - handleDeny() { + public handleDeny(): void { alert(this.state.selected); } - handleRowActive(id: string):boolean { + public handleRowActive(id: string):boolean { if (this.state.selected.indexOf(id) === -1) { return false; } return true; } - render() { + public render(): JSX.Element { return ( diff --git a/src/ts/@overflow/temp/react/components/ProbeDetails.tsx b/src/ts/@overflow/temp/react/components/ProbeDetails.tsx index 3d14ab8..b8daa96 100644 --- a/src/ts/@overflow/temp/react/components/ProbeDetails.tsx +++ b/src/ts/@overflow/temp/react/components/ProbeDetails.tsx @@ -2,7 +2,15 @@ import * as React from 'react'; import { Button, Table, Label, Segment, Header, Container } from 'semantic-ui-react'; import { TargetTable } from './Targets'; -export class ProbeDetails extends React.Component { +export interface Props { + probe: object; +} + +export interface State { +} + + +export class ProbeDetails extends React.Component { constructor(props: any, context: any) { super(props, context); @@ -10,11 +18,11 @@ export class ProbeDetails extends React.Component { }; } - componentWillMount() { - + public componentWillMount(): void { + super.componentWillMount(); } - render() { + public render(): JSX.Element { return ( @@ -32,19 +40,19 @@ export class ProbeBasicInfo extends React.Component { }; } - handleStartStop(event: any, data: any) { + public handleStartStop(event: any, data: any): void { console.log(event); } - handleDiscovery(event: any, data: any) { + public handleDiscovery(event: any, data: any): void { alert('Discovery'); } - handleBack(event: any, data: any) { + public handleBack(event: any, data: any): void { this.props.onBack(); } - showStartStopBtn() { + public showStartStopBtn(): JSX.Element { if (this.props.probe.metaProbeStatus.name === 'STARTED') { return