diff --git a/src/ts/@overflow/infra/api/model/Infra.ts b/src/ts/@overflow/infra/api/model/Infra.ts index 7130112..069bf99 100644 --- a/src/ts/@overflow/infra/api/model/Infra.ts +++ b/src/ts/@overflow/infra/api/model/Infra.ts @@ -3,9 +3,9 @@ import MetaInfraType from '@overflow/meta/api/model/MetaInfraType'; import Probe from '@overflow/probe/api/model/Probe'; import Target from '@overflow/target/api/model/Target'; -interface Infra { - id: number; - type: MetaInfraType; +export interface Infra { + id?: number; + infraType: MetaInfraType; childId: number; createDate: Date; probe: Probe; diff --git a/src/ts/@overflow/infra/api/model/InfraOS.ts b/src/ts/@overflow/infra/api/model/InfraOS.ts index cae3dea..e6e219e 100644 --- a/src/ts/@overflow/infra/api/model/InfraOS.ts +++ b/src/ts/@overflow/infra/api/model/InfraOS.ts @@ -3,7 +3,7 @@ import MetaInfraVendor from '@overflow/meta/api/model/MetaInfraVendor'; interface InfraOS { - id: number; + id?: number; machine: InfraMachine; meta: string; createDate: Date; diff --git a/src/ts/@overflow/infra/api/model/InfraOSApplication.ts b/src/ts/@overflow/infra/api/model/InfraOSApplication.ts index a4cc2cd..b943d46 100644 --- a/src/ts/@overflow/infra/api/model/InfraOSApplication.ts +++ b/src/ts/@overflow/infra/api/model/InfraOSApplication.ts @@ -2,7 +2,7 @@ import InfraOS from './InfraOS'; interface InfraOSApplication { - id: number; + id?: number; os: InfraOS; name: string; createDate: Date; diff --git a/src/ts/@overflow/infra/api/model/InfraOSDaemon.ts b/src/ts/@overflow/infra/api/model/InfraOSDaemon.ts index cb56933..74e42b3 100644 --- a/src/ts/@overflow/infra/api/model/InfraOSDaemon.ts +++ b/src/ts/@overflow/infra/api/model/InfraOSDaemon.ts @@ -1,7 +1,7 @@ import InfraOS from './InfraOS'; interface InfraOSDaemon { - id: number; + id?: number; os: InfraOS; name: string; createDate: Date; diff --git a/src/ts/@overflow/infra/api/model/InfraOSPort.ts b/src/ts/@overflow/infra/api/model/InfraOSPort.ts index 617d503..1ce58af 100644 --- a/src/ts/@overflow/infra/api/model/InfraOSPort.ts +++ b/src/ts/@overflow/infra/api/model/InfraOSPort.ts @@ -2,7 +2,7 @@ import InfraOS from './InfraOS'; import MetaInfraVendor from '@overflow/meta/api/model/MetaInfraVendor'; interface InfraOSPort { - id: number; + id?: number; os: InfraOS; createDate: Date; port: number; diff --git a/src/ts/@overflow/infra/api/model/InfraService.ts b/src/ts/@overflow/infra/api/model/InfraService.ts index 5356c80..ec867b8 100644 --- a/src/ts/@overflow/infra/api/model/InfraService.ts +++ b/src/ts/@overflow/infra/api/model/InfraService.ts @@ -2,7 +2,7 @@ import InfraHost from './InfraHost'; import MetaInfraVendor from '@overflow/meta/api/model/MetaInfraVendor'; interface InfraService { - id: number; + id?: number; host: InfraHost; portType: string; port: number; diff --git a/src/ts/@overflow/meta/api/model/MetaCrawlerInputItem.ts b/src/ts/@overflow/meta/api/model/MetaCrawlerInputItem.ts index 43d5c36..41791a5 100644 --- a/src/ts/@overflow/meta/api/model/MetaCrawlerInputItem.ts +++ b/src/ts/@overflow/meta/api/model/MetaCrawlerInputItem.ts @@ -2,10 +2,10 @@ import MetaInputType from './MetaInputType'; import MetaCrawler from './MetaCrawler'; -interface MetaCrawlerInputItem { - id: number; - metaInputType: MetaInputType; - metaCrawler: MetaCrawler; +export interface MetaCrawlerInputItem { + id?: number; + inputType: MetaInputType; + crawler: MetaCrawler; description: string; name: string; createDate: Date; diff --git a/src/ts/@overflow/meta/api/model/MetaInfraType.ts b/src/ts/@overflow/meta/api/model/MetaInfraType.ts index d83f4f2..09acfc8 100644 --- a/src/ts/@overflow/meta/api/model/MetaInfraType.ts +++ b/src/ts/@overflow/meta/api/model/MetaInfraType.ts @@ -1,6 +1,6 @@ interface MetaInfraType { - id: number; + id?: number; name: string; createDate: Date; } diff --git a/src/ts/@overflow/meta/api/model/MetaInfraVendor.ts b/src/ts/@overflow/meta/api/model/MetaInfraVendor.ts index 356716d..7060043 100644 --- a/src/ts/@overflow/meta/api/model/MetaInfraVendor.ts +++ b/src/ts/@overflow/meta/api/model/MetaInfraVendor.ts @@ -2,10 +2,10 @@ import MetaInfraType from './MetaInfraType'; interface MetaInfraVendor { - id: number; + id?: number; name: string; createDate: Date; - metaInfraType: MetaInfraType; + infraType: MetaInfraType; } export enum MetaInfraVendor_Machine_ID { diff --git a/src/ts/@overflow/meta/api/model/MetaInputType.ts b/src/ts/@overflow/meta/api/model/MetaInputType.ts index 53c951e..c736b0d 100644 --- a/src/ts/@overflow/meta/api/model/MetaInputType.ts +++ b/src/ts/@overflow/meta/api/model/MetaInputType.ts @@ -1,6 +1,6 @@ interface MetaInputType { - id: number; + id?: number; name: string; description: string; createDate: Date; diff --git a/src/ts/@overflow/meta/api/model/MetaNoAuthProbeStatus.ts b/src/ts/@overflow/meta/api/model/MetaNoAuthProbeStatus.ts index 3aef3d8..680bc8e 100644 --- a/src/ts/@overflow/meta/api/model/MetaNoAuthProbeStatus.ts +++ b/src/ts/@overflow/meta/api/model/MetaNoAuthProbeStatus.ts @@ -1,6 +1,6 @@ interface MetaNoAuthProbeStatus { - id: number; + id?: number; name: string; } diff --git a/src/ts/@overflow/meta/api/model/MetaNotification.ts b/src/ts/@overflow/meta/api/model/MetaNotification.ts index c6051c2..3fd0ae9 100644 --- a/src/ts/@overflow/meta/api/model/MetaNotification.ts +++ b/src/ts/@overflow/meta/api/model/MetaNotification.ts @@ -1,6 +1,6 @@ interface MetaNotification { - id: number; + id?: number; createDate: Date; name: string; description: string; diff --git a/src/ts/@overflow/meta/api/model/MetaProbeArchitecture.ts b/src/ts/@overflow/meta/api/model/MetaProbeArchitecture.ts index 0137ade..7724ae8 100644 --- a/src/ts/@overflow/meta/api/model/MetaProbeArchitecture.ts +++ b/src/ts/@overflow/meta/api/model/MetaProbeArchitecture.ts @@ -1,6 +1,6 @@ interface MetaProbeArchitecture { - id: number; + id?: number; architecture: string; createDate: Date; } diff --git a/src/ts/@overflow/meta/api/model/MetaProbeOs.ts b/src/ts/@overflow/meta/api/model/MetaProbeOs.ts index 61f1e70..5518ec1 100644 --- a/src/ts/@overflow/meta/api/model/MetaProbeOs.ts +++ b/src/ts/@overflow/meta/api/model/MetaProbeOs.ts @@ -1,6 +1,6 @@ interface MetaProbeOs { - id: number; + id?: number; name: string; createDate: Date; } diff --git a/src/ts/@overflow/meta/api/model/MetaProbePackage.ts b/src/ts/@overflow/meta/api/model/MetaProbePackage.ts index 8e89556..a929030 100644 --- a/src/ts/@overflow/meta/api/model/MetaProbePackage.ts +++ b/src/ts/@overflow/meta/api/model/MetaProbePackage.ts @@ -3,7 +3,7 @@ import MetaProbeOs from './MetaProbeOs'; import MetaProbeArchitecture from './MetaProbeArchitecture'; interface MetaProbePackage { - id: number; + id?: number; version: MetaProbeVersion; os: MetaProbeOs; architecture: MetaProbeArchitecture; diff --git a/src/ts/@overflow/meta/api/model/MetaProbeTaskType.ts b/src/ts/@overflow/meta/api/model/MetaProbeTaskType.ts index e88994e..57faefb 100644 --- a/src/ts/@overflow/meta/api/model/MetaProbeTaskType.ts +++ b/src/ts/@overflow/meta/api/model/MetaProbeTaskType.ts @@ -1,6 +1,6 @@ interface MetaProbeTaskType { - id: number; + id?: number; name: string; description: string; createDate: Date; diff --git a/src/ts/@overflow/meta/api/model/MetaProbeVersion.ts b/src/ts/@overflow/meta/api/model/MetaProbeVersion.ts index 6147966..1d25c04 100644 --- a/src/ts/@overflow/meta/api/model/MetaProbeVersion.ts +++ b/src/ts/@overflow/meta/api/model/MetaProbeVersion.ts @@ -1,6 +1,6 @@ interface MetaProbeVersion { - id: number; + id?: number; version: string; createDate: Date; } diff --git a/src/ts/@overflow/meta/api/model/MetaSensorItem.ts b/src/ts/@overflow/meta/api/model/MetaSensorItem.ts index a5451f9..2b9895f 100644 --- a/src/ts/@overflow/meta/api/model/MetaSensorItem.ts +++ b/src/ts/@overflow/meta/api/model/MetaSensorItem.ts @@ -3,8 +3,8 @@ import MetaProbeArchitecture from './MetaProbeArchitecture'; import MetaSensorItemType from './MetaSensorItemType'; interface MetaSensorItem { - id: number; - metaSensorItemType: MetaSensorItemType; + id?: number; + itemType: MetaSensorItemType; key: string; name: string; createDate: Date; diff --git a/src/ts/@overflow/meta/api/model/MetaSensorItemType.ts b/src/ts/@overflow/meta/api/model/MetaSensorItemType.ts index d185a10..e9aed76 100644 --- a/src/ts/@overflow/meta/api/model/MetaSensorItemType.ts +++ b/src/ts/@overflow/meta/api/model/MetaSensorItemType.ts @@ -1,6 +1,6 @@ interface MetaSensorItemType { - id: number; + id?: number; name: string; description: string; createDate: Date; diff --git a/src/ts/@overflow/meta/api/model/MetaSensorStatus.ts b/src/ts/@overflow/meta/api/model/MetaSensorStatus.ts index 007c3b2..322e559 100644 --- a/src/ts/@overflow/meta/api/model/MetaSensorStatus.ts +++ b/src/ts/@overflow/meta/api/model/MetaSensorStatus.ts @@ -1,6 +1,6 @@ interface MetaSensorStatus { - id: number; + id?: number; name: string; } diff --git a/src/ts/@overflow/meta/api/model/MetaVendorCrawler.ts b/src/ts/@overflow/meta/api/model/MetaVendorCrawler.ts index f02529e..e53d8b2 100644 --- a/src/ts/@overflow/meta/api/model/MetaVendorCrawler.ts +++ b/src/ts/@overflow/meta/api/model/MetaVendorCrawler.ts @@ -1,10 +1,11 @@ import MetaInfraVendor from './MetaInfraVendor'; import MetaCrawler from './MetaCrawler'; + interface MetaVendorCrawler { - id: number; - metaCrawler: MetaCrawler; - metaInfraVendor: MetaInfraVendor; + id?: number; + crawler: MetaCrawler; + infraVendor: MetaInfraVendor; createDate: Date; } diff --git a/src/ts/@overflow/meta/api/model/MetaVendorCrawlerSensorItem.ts b/src/ts/@overflow/meta/api/model/MetaVendorCrawlerSensorItem.ts index 3844eea..edbd3c1 100644 --- a/src/ts/@overflow/meta/api/model/MetaVendorCrawlerSensorItem.ts +++ b/src/ts/@overflow/meta/api/model/MetaVendorCrawlerSensorItem.ts @@ -3,12 +3,12 @@ import MetaInfraVendor from './MetaInfraVendor'; import MetaSensorItem from './MetaSensorItem'; interface MetaVendorCrawlerSensorItem { - id: number; + id?: number; interval: string; warnCondition: string; createDate: Date; - metaSensorItem: MetaSensorItem; - metaInfraVendor: MetaInfraVendor; + sensorItem: MetaSensorItem; + vendor: MetaInfraVendor; crawlerId: number; } diff --git a/src/ts/@overflow/probe/api/model/Probe.ts b/src/ts/@overflow/probe/api/model/Probe.ts index c3f53ba..bc7eaa6 100644 --- a/src/ts/@overflow/probe/api/model/Probe.ts +++ b/src/ts/@overflow/probe/api/model/Probe.ts @@ -7,8 +7,8 @@ interface Probe { id?: number; status: MetaProbeStatus; // INITIAL / NORMAL description: string; - createDate?: Date; - domain?: Domain; + createDate: Date; + domain: Domain; probeKey: string; encryptionKey: string; targetCount: number; diff --git a/src/ts/@overflow/probe/api/model/ProbeTask.ts b/src/ts/@overflow/probe/api/model/ProbeTask.ts index 4d3bb91..eb1f25b 100644 --- a/src/ts/@overflow/probe/api/model/ProbeTask.ts +++ b/src/ts/@overflow/probe/api/model/ProbeTask.ts @@ -3,13 +3,13 @@ import MetaProbeTaskType from '@overflow/meta/api/model/MetaProbeTaskType'; interface ProbeTask { id?: number; - metaProbeTaskType: MetaProbeTaskType; + taskType: MetaProbeTaskType; probe: Probe; data: string; - createDate?: Date; - sendDate?: Date; - startDate?: Date; - endDate?: Date; + createDate: Date; + sendDate: Date; + startDate: Date; + endDate: Date; succeed: boolean; } diff --git a/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx b/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx index 2f23f48..c0d8dc3 100644 --- a/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx +++ b/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx @@ -8,7 +8,7 @@ import { Container, } from 'semantic-ui-react'; import Probe from '@overflow/probe/api/model/Probe'; -import { Discovery } from '../../../discovery/react/components/Discovery'; +import { Discovery } from '@overflow/discovery/react/components/Discovery'; export interface StateProps { id: string; @@ -49,10 +49,6 @@ export class ProbeDetailInfo extends React.Component { }, 'cidr': '192.168.1.0/24', 'displayName': '192.168.1.105\'s probe', - 'infraHost': { - 'ip': '192.168.1.105', - 'mac': 'ab:cd:ef:gh:ij', - }, 'targetCount': '20', 'sensorCount': '30', 'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ', diff --git a/src/ts/@overflow/probe/react/components/ProbeHost.tsx b/src/ts/@overflow/probe/react/components/ProbeHost.tsx index dcc67ec..b504fc3 100644 --- a/src/ts/@overflow/probe/react/components/ProbeHost.tsx +++ b/src/ts/@overflow/probe/react/components/ProbeHost.tsx @@ -8,6 +8,7 @@ import { Container, } from 'semantic-ui-react'; import Probe from '@overflow/probe/api/model/Probe'; +import InfraHost from '@overflow/infra/api/model/InfraHost'; export interface StateProps { id: string; @@ -19,7 +20,7 @@ export interface DispatchProps { export type Props = StateProps & DispatchProps; export interface State { - probe: any; // todo. fix to Probe + host: InfraHost; } @@ -28,14 +29,14 @@ export class ProbeHost extends React.Component { constructor(props: Props, context: State) { super(props, context); this.state = { - probe: null, + host: null, }; } public componentWillMount(): void { // todo. getting probe by probeId - let p = { + let p: any = { 'id': '11', 'status': { 'name': 'STARTED', @@ -43,22 +44,28 @@ export class ProbeHost extends React.Component { 'domain': { 'name': 'insanity\'s domain', }, - 'cidr': '192.168.1.0/24', - 'displayName': '192.168.1.105\'s probe', - 'targetCount': '20', - 'sensorCount': '30', - 'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ', - 'description': 'description1111111111', - 'createDate': '2017-01-01', - 'authorizeDate': '2017-01-01', - 'restartDate': '2017-01-01', - 'authorizeMember': { - 'name': 'insanity', + 'host': { + 'id': 111, + 'os': { + 'machine': { + 'meta': 'machine meta', + }, + 'meta': 'os meta', + 'vendor': { + 'name': 'vendor name', + 'type': { + 'name': 'vendor type name', + }, + }, + }, + 'ip': 3232235881, + 'mac': 8796753988883, + 'createDate': null, }, }; this.setState({ - probe: p, + host: p.host, }); } @@ -70,9 +77,33 @@ export class ProbeHost extends React.Component { -
Name
+
IP
- todo + {this.state.host.ip} +
+ + +
MAC
+
+ {this.state.host.mac} +
+ + +
OS meta
+
+ {this.state.host.os.meta} +
+ + +
OS vendor name
+
+ {this.state.host.os.vendor.name} +
+ + +
OS vendor type
+
+ {this.state.host.os.vendor.type.name}
diff --git a/src/ts/@overflow/probe/react/components/ProbeList.tsx b/src/ts/@overflow/probe/react/components/ProbeList.tsx index 003d6bb..c717c79 100644 --- a/src/ts/@overflow/probe/react/components/ProbeList.tsx +++ b/src/ts/@overflow/probe/react/components/ProbeList.tsx @@ -35,7 +35,7 @@ export class ProbeList extends React.Component { public componentWillMount(): void { this.data = [ { - 'id': '11', + 'id': 11, 'status': { 'name': 'NORMAL', }, @@ -48,13 +48,13 @@ export class ProbeList extends React.Component { // 'ip': '192.168.1.105', // 'mac': 'ab:cd:ef:gh:ij', // }, - 'targetCount': '20', - 'sensorCount': '30', + 'targetCount': 20, + 'sensorCount': 30, 'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ', 'description': 'description1111111111', }, { - 'id': '22', + 'id': 22, 'status': { 'name': 'INITIAL', }, @@ -63,13 +63,13 @@ export class ProbeList extends React.Component { }, 'displayName': '192.168.1.105\'s probe', 'cidr': '192.168.1.0/24', - 'targetCount': '20', - 'sensorCount': '30', + 'targetCount': 30, + 'sensorCount': 40, 'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ', 'description': 'description1111111111', }, { - 'id': '33', + 'id': 33, 'status': { 'name': 'NORMAL', }, @@ -78,8 +78,8 @@ export class ProbeList extends React.Component { }, 'cidr': '192.168.1.0/24', 'displayName': '192.168.1.105\'s probe', - 'targetCount': '20', - 'sensorCount': '30', + 'targetCount': 50, + 'sensorCount': 60, 'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ', 'description': 'description1111111111', },