From 3870bc5cbe99b0c5e198b96de4ae5de3f763a2d2 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 20 Jul 2017 13:54:11 +0900 Subject: [PATCH] fixed lint --- .../temp/react/components/Targets.tsx | 4 +- .../temp/react/components/commons/Tree.tsx | 146 ++++++++++-------- 2 files changed, 84 insertions(+), 66 deletions(-) diff --git a/src/ts/@overflow/temp/react/components/Targets.tsx b/src/ts/@overflow/temp/react/components/Targets.tsx index 2cfd435..f6e6fe9 100644 --- a/src/ts/@overflow/temp/react/components/Targets.tsx +++ b/src/ts/@overflow/temp/react/components/Targets.tsx @@ -72,7 +72,7 @@ export interface TargetTableProps { export interface TargetTableState { list: Array; - selected: object; + selected: Target; } export class TargetTable extends React.Component { @@ -85,7 +85,7 @@ export class TargetTable extends React.Component { +export class Tree extends React.Component { constructor(props: any, context: any) { super(props, context); @@ -33,7 +35,7 @@ export class Tree extends React.Component { } - render() { + public render(): JSX.Element { return ( @@ -45,8 +47,15 @@ export class Tree extends React.Component { } +export interface SensorItemTreeProps { +} -export class SensorItemTree extends React.Component { +export interface SensorItemTreeState { + +} + + +export class SensorItemTree extends React.Component { constructor(props: any, context: any) { super(props, context); @@ -59,12 +68,12 @@ export class SensorItemTree extends React.Component { // fs.readFile('../../../../../dh.json', this.handlJSONFile); } - render() { + public render(): JSX.Element { return ( - {SensorJsonData.map((data: any, idx: number)=> { - + {SensorJsonData.map((data: any, idx: number) => { + console.log(''); })} @@ -74,24 +83,24 @@ export class SensorItemTree extends React.Component { } const SensorTypeJsonData = [ - { - 'id' : 1, - 'create_date' : '2017-06-26T10:49:39Z', - 'description' : 'CPU blah blah blah', - 'name' : 'CPU' - }, - { - 'id' : 2, - 'create_date' : '2017-06-26T10:49:39Z', - 'description' : 'MEMORY blah blah blah', - 'name' : 'MEMORY' - }, - { - 'id' : 3, - 'create_date' : '2017-06-26T10:49:39Z', - 'description' : 'DISK blah blah blah', - 'name' : 'DISK' - } + { + 'id': 1, + 'create_date': '2017-06-26T10:49:39Z', + 'description': 'CPU blah blah blah', + 'name': 'CPU', + }, + { + 'id': 2, + 'create_date': '2017-06-26T10:49:39Z', + 'description': 'MEMORY blah blah blah', + 'name': 'MEMORY', + }, + { + 'id': 3, + 'create_date': '2017-06-26T10:49:39Z', + 'description': 'DISK blah blah blah', + 'name': 'DISK', + }, ]; const SensorJsonData = [ @@ -100,38 +109,47 @@ const SensorJsonData = [ 'create_date': '2017-06-26T11:10:08Z', 'key': 'cpu.usage', 'name': 'CPU USAGE', - 'type_id': 1 + 'type_id': 1, }, { 'id': 2, 'create_date': '2017-06-26T11:10:08Z', 'key': 'cpu.free', 'name': 'CPU FREE', - 'type_id': 1 + 'type_id': 1, }, { 'id': 3, 'create_date': '2017-06-26T11:10:08Z', 'key': 'mem.usage', 'name': 'MEMORY USAGE', - 'type_id': 2 + 'type_id': 2, }, { 'id': 4, 'create_date': '2017-06-26T11:10:08Z', 'key': 'mem.free', 'name': 'MEMORY FREE', - 'type_id': 2 - } + 'type_id': 2, + }, ]; -export class DiscoveryResult extends React.Component { + +export interface DiscoveryResultProps { +} + +export interface DiscoveryResultState { + portState: { [key: number]: boolean; }; +} + + +export class DiscoveryResult extends React.Component { constructor(props: any, context: any) { super(props, context); this.state = { - portState: [], + portState: {}, }; @@ -139,7 +157,7 @@ export class DiscoveryResult extends React.Component { } - render() { + public render(): JSX.Element { return ( @@ -239,10 +257,10 @@ const jsonData = [{ 'updateDate': -62135596800000, 'portType': 'TCP', 'serviceName': 'SSH', - 'target': true + 'target': true, }], 'portType': 'TCP', - 'portNumber': 22 + 'portNumber': 22, }, { 'createDate': -62135596800000, @@ -251,10 +269,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 443 + 'portNumber': 443, }, { 'createDate': -62135596800000, @@ -263,13 +281,13 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 80 + 'portNumber': 80, }], 'createDate': 1498470178000, - 'updateDate': 1498470178000 + 'updateDate': 1498470178000, }, { 'firstScanRange': 1, @@ -285,10 +303,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'SSH' + 'serviceName': 'SSH', }], 'portType': 'TCP', - 'portNumber': 22 + 'portNumber': 22, }, { 'createDate': -62135596800000, @@ -297,10 +315,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 80 + 'portNumber': 80, }, { 'createDate': -62135596800000, @@ -309,20 +327,20 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 1936 + 'portNumber': 1936, }, { 'createDate': -62135596800000, 'updateDate': -62135596800000, 'services': null, 'portType': 'TCP', - 'portNumber': 443 + 'portNumber': 443, }], 'createDate': 1498470178000, - 'updateDate': 1498470178000 + 'updateDate': 1498470178000, }, { 'firstScanRange': 1, @@ -339,10 +357,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 80 + 'portNumber': 80, }, { 'createDate': -62135596800000, @@ -351,10 +369,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'SSH' + 'serviceName': 'SSH', }], 'portType': 'TCP', - 'portNumber': 22 + 'portNumber': 22, }, { 'createDate': -62135596800000, @@ -363,10 +381,10 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 3343 + 'portNumber': 3343, }, { 'createDate': -62135596800000, @@ -375,13 +393,13 @@ const jsonData = [{ 'createDate': -62135596800000, 'updateDate': -62135596800000, 'portType': 'TCP', - 'serviceName': 'HTTP' + 'serviceName': 'HTTP', }], 'portType': 'TCP', - 'portNumber': 443 + 'portNumber': 443, }], 'createDate': 1498470178000, - 'updateDate': 1498470178000 + 'updateDate': 1498470178000, }, { 'firstScanRange': 1, @@ -392,8 +410,8 @@ const jsonData = [{ 'os': 'Windows', 'ports': null, 'createDate': 1498470179000, - 'updateDate': 1498470179000 -} + 'updateDate': 1498470179000, +}, -] \ No newline at end of file +];