fixed lint

This commit is contained in:
snoop 2017-07-20 13:54:11 +09:00
parent 0569b7861e
commit 3870bc5cbe
2 changed files with 84 additions and 66 deletions

View File

@ -72,7 +72,7 @@ export interface TargetTableProps {
export interface TargetTableState { export interface TargetTableState {
list: Array<Target>; list: Array<Target>;
selected: object; selected: Target;
} }
export class TargetTable extends React.Component<TargetTableProps, TargetTableState> { export class TargetTable extends React.Component<TargetTableProps, TargetTableState> {
@ -85,7 +85,7 @@ export class TargetTable extends React.Component<TargetTableProps, TargetTableSt
list: [], list: [],
}; };
} }
public handleSelect(selectedTarget: object): void { public handleSelect(selectedTarget: Target): void {
this.setState({ this.setState({
selected: selectedTarget, selected: selectedTarget,
}); });

View File

@ -1,11 +1,6 @@
import * as React from 'react'; import * as React from 'react';
// import update from 'immutability-helper'; // import update from 'immutability-helper';
import { Checkbox, Container, Label, Accordion, Icon, List, ListItemProps } from 'semantic-ui-react'; import { Checkbox, Container, Label, Accordion, Icon, List, ListItemProps } from 'semantic-ui-react';
@ -19,10 +14,17 @@ import * as Utils from '@overflow/commons/utils/Utils';
export interface Props {
}
export interface State {
}
// import update from 'immutability-helper' // import update from 'immutability-helper'
export class Tree extends React.Component<any, any> { export class Tree extends React.Component<Props, State> {
constructor(props: any, context: any) { constructor(props: any, context: any) {
super(props, context); super(props, context);
@ -33,7 +35,7 @@ export class Tree extends React.Component<any, any> {
} }
render() { public render(): JSX.Element {
return ( return (
<Container> <Container>
<SensorItemTree /> <SensorItemTree />
@ -45,8 +47,15 @@ export class Tree extends React.Component<any, any> {
} }
export interface SensorItemTreeProps {
}
export class SensorItemTree extends React.Component<any, any> { export interface SensorItemTreeState {
}
export class SensorItemTree extends React.Component<SensorItemTreeProps, SensorItemTreeState> {
constructor(props: any, context: any) { constructor(props: any, context: any) {
super(props, context); super(props, context);
@ -59,12 +68,12 @@ export class SensorItemTree extends React.Component<any, any> {
// fs.readFile('../../../../../dh.json', this.handlJSONFile); // fs.readFile('../../../../../dh.json', this.handlJSONFile);
} }
render() { public render(): JSX.Element {
return ( return (
<Container> <Container>
<List selection> <List selection>
{SensorJsonData.map((data: any, idx: number)=> { {SensorJsonData.map((data: any, idx: number) => {
console.log('');
})} })}
</List> </List>
</Container> </Container>
@ -75,23 +84,23 @@ export class SensorItemTree extends React.Component<any, any> {
const SensorTypeJsonData = [ const SensorTypeJsonData = [
{ {
'id' : 1, 'id': 1,
'create_date' : '2017-06-26T10:49:39Z', 'create_date': '2017-06-26T10:49:39Z',
'description' : 'CPU blah blah blah', 'description': 'CPU blah blah blah',
'name' : 'CPU' 'name': 'CPU',
}, },
{ {
'id' : 2, 'id': 2,
'create_date' : '2017-06-26T10:49:39Z', 'create_date': '2017-06-26T10:49:39Z',
'description' : 'MEMORY blah blah blah', 'description': 'MEMORY blah blah blah',
'name' : 'MEMORY' 'name': 'MEMORY',
}, },
{ {
'id' : 3, 'id': 3,
'create_date' : '2017-06-26T10:49:39Z', 'create_date': '2017-06-26T10:49:39Z',
'description' : 'DISK blah blah blah', 'description': 'DISK blah blah blah',
'name' : 'DISK' 'name': 'DISK',
} },
]; ];
const SensorJsonData = [ const SensorJsonData = [
@ -100,38 +109,47 @@ const SensorJsonData = [
'create_date': '2017-06-26T11:10:08Z', 'create_date': '2017-06-26T11:10:08Z',
'key': 'cpu.usage', 'key': 'cpu.usage',
'name': 'CPU USAGE', 'name': 'CPU USAGE',
'type_id': 1 'type_id': 1,
}, },
{ {
'id': 2, 'id': 2,
'create_date': '2017-06-26T11:10:08Z', 'create_date': '2017-06-26T11:10:08Z',
'key': 'cpu.free', 'key': 'cpu.free',
'name': 'CPU FREE', 'name': 'CPU FREE',
'type_id': 1 'type_id': 1,
}, },
{ {
'id': 3, 'id': 3,
'create_date': '2017-06-26T11:10:08Z', 'create_date': '2017-06-26T11:10:08Z',
'key': 'mem.usage', 'key': 'mem.usage',
'name': 'MEMORY USAGE', 'name': 'MEMORY USAGE',
'type_id': 2 'type_id': 2,
}, },
{ {
'id': 4, 'id': 4,
'create_date': '2017-06-26T11:10:08Z', 'create_date': '2017-06-26T11:10:08Z',
'key': 'mem.free', 'key': 'mem.free',
'name': 'MEMORY FREE', 'name': 'MEMORY FREE',
'type_id': 2 'type_id': 2,
} },
]; ];
export class DiscoveryResult extends React.Component<any, any> {
export interface DiscoveryResultProps {
}
export interface DiscoveryResultState {
portState: { [key: number]: boolean; };
}
export class DiscoveryResult extends React.Component<DiscoveryResultProps, DiscoveryResultState> {
constructor(props: any, context: any) { constructor(props: any, context: any) {
super(props, context); super(props, context);
this.state = { this.state = {
portState: [], portState: {},
}; };
@ -139,7 +157,7 @@ export class DiscoveryResult extends React.Component<any, any> {
} }
render() { public render(): JSX.Element {
return ( return (
<Container> <Container>
@ -239,10 +257,10 @@ const jsonData = [{
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'SSH', 'serviceName': 'SSH',
'target': true 'target': true,
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 22 'portNumber': 22,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -251,10 +269,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 443 'portNumber': 443,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -263,13 +281,13 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 80 'portNumber': 80,
}], }],
'createDate': 1498470178000, 'createDate': 1498470178000,
'updateDate': 1498470178000 'updateDate': 1498470178000,
}, },
{ {
'firstScanRange': 1, 'firstScanRange': 1,
@ -285,10 +303,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'SSH' 'serviceName': 'SSH',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 22 'portNumber': 22,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -297,10 +315,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 80 'portNumber': 80,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -309,20 +327,20 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 1936 'portNumber': 1936,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'services': null, 'services': null,
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 443 'portNumber': 443,
}], }],
'createDate': 1498470178000, 'createDate': 1498470178000,
'updateDate': 1498470178000 'updateDate': 1498470178000,
}, },
{ {
'firstScanRange': 1, 'firstScanRange': 1,
@ -339,10 +357,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 80 'portNumber': 80,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -351,10 +369,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'SSH' 'serviceName': 'SSH',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 22 'portNumber': 22,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -363,10 +381,10 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 3343 'portNumber': 3343,
}, },
{ {
'createDate': -62135596800000, 'createDate': -62135596800000,
@ -375,13 +393,13 @@ const jsonData = [{
'createDate': -62135596800000, 'createDate': -62135596800000,
'updateDate': -62135596800000, 'updateDate': -62135596800000,
'portType': 'TCP', 'portType': 'TCP',
'serviceName': 'HTTP' 'serviceName': 'HTTP',
}], }],
'portType': 'TCP', 'portType': 'TCP',
'portNumber': 443 'portNumber': 443,
}], }],
'createDate': 1498470178000, 'createDate': 1498470178000,
'updateDate': 1498470178000 'updateDate': 1498470178000,
}, },
{ {
'firstScanRange': 1, 'firstScanRange': 1,
@ -392,8 +410,8 @@ const jsonData = [{
'os': 'Windows', 'os': 'Windows',
'ports': null, 'ports': null,
'createDate': 1498470179000, 'createDate': 1498470179000,
'updateDate': 1498470179000 'updateDate': 1498470179000,
} },
] ];