From e357030fe8d2bf388f9ee0b7b9147e9d0819da20 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 26 Apr 2018 20:23:57 +0900 Subject: [PATCH] probe error fix --- src/environments/environment.ts | 4 +- .../host-summary/host-summary.component.html | 6 +- .../infra/component/map/map.component.html | 6 +- .../infra/component/map/map.component.ts | 59 ++++++++++++++----- src/packages/infra/infra.module.ts | 4 +- src/packages/infra/model/InfraHost.ts | 3 +- .../probe/component/list/list.component.html | 9 ++- .../probe/component/list/list.component.ts | 2 +- 8 files changed, 64 insertions(+), 29 deletions(-) diff --git a/src/environments/environment.ts b/src/environments/environment.ts index a586811..b6a2113 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,9 +5,9 @@ export const environment = { production: false, - restBaseURL: 'http://192.168.1.50:19080/webapp', + restBaseURL: 'http://192.168.1.103:19080/webapp', webappRPCConfig: { - url: 'ws://192.168.1.50:19090/webapp', + url: 'ws://192.168.1.103:19090/webapp', reconnectInterval: 5000, reconnectRetry: 10, }, diff --git a/src/packages/infra/component/host-summary/host-summary.component.html b/src/packages/infra/component/host-summary/host-summary.component.html index 7944a1e..fe36ce1 100644 --- a/src/packages/infra/component/host-summary/host-summary.component.html +++ b/src/packages/infra/component/host-summary/host-summary.component.html @@ -1,5 +1,5 @@
- {{ host.ip }} - {{ host.mac }} - {{ host.os.vendor.name }} + + +
\ No newline at end of file diff --git a/src/packages/infra/component/map/map.component.html b/src/packages/infra/component/map/map.component.html index 429b218..de969de 100644 --- a/src/packages/infra/component/map/map.component.html +++ b/src/packages/infra/component/map/map.component.html @@ -61,7 +61,7 @@ - +
@@ -73,6 +73,10 @@
+ + + + diff --git a/src/packages/infra/component/map/map.component.ts b/src/packages/infra/component/map/map.component.ts index 7538215..d75c9c7 100644 --- a/src/packages/infra/component/map/map.component.ts +++ b/src/packages/infra/component/map/map.component.ts @@ -68,6 +68,8 @@ export class MapComponent implements OnInit, AfterContentInit { selectedNode: TreeNode = null; targetNodeForView: Object = null; + sensorSettingDisplay = false; + constructor(private router: Router, private listStore: Store, private sensorListStore: Store @@ -80,7 +82,7 @@ export class MapComponent implements OnInit, AfterContentInit { const pageParams: PageParams = { pageNo: '0', - countPerPage: '10', + countPerPage: '99999', sortCol: 'id', sortDirection: 'descending' }; @@ -91,8 +93,9 @@ export class MapComponent implements OnInit, AfterContentInit { console.log(error); } ); + } - + ngOnInit() { this.infras$.subscribe( (page: Page) => { console.log(page); @@ -118,34 +121,34 @@ export class MapComponent implements OnInit, AfterContentInit { console.log(error.response.message); } ); - } - - ngOnInit() { this.initContextMenu(); } initContextMenu() { this.contextMenuProbe = [ { label: 'Probe Menu', command: (event) => this.closeContextMenu() }, - { label: 'View info', icon: 'fa-plus', command: (event) => this.viewInfo() } + { label: 'View this Probe', icon: 'fa-plus', command: (event) => this.viewInfo() }, + { label: 'Discovery', icon: 'fa-plus', command: (event) => this.discovery() }, + { label: 'Edit Alias', icon: 'fa-plus', command: (event) => this.editProbeAlias() }, ]; this.contextMenuHost = [ { label: 'Host Menu', command: (event) => this.closeContextMenu() }, { label: 'View this Host', icon: 'fa-plus', command: (event) => this.viewInfo() }, - { label: 'Add sensor', icon: 'fa-plus', command: (event) => this.addSensor() }, - { label: 'Traceroute', icon: 'fa-plus' }, - { label: 'ARP Test', icon: 'fa-plus' }, - { label: 'Ping Test', icon: 'fa-plus' }, + { label: 'Add sensor', icon: 'fa-plus', command: (event) => this.addSensorWithTarget() }, + { label: 'Traceroute', icon: 'fa-plus', command: (event) => this.testTraceroute() }, + { label: 'ARP Test', icon: 'fa-plus', command: (event) => this.testARP() }, + { label: 'Ping Test', icon: 'fa-plus', command: (event) => this.testPing() }, ]; this.contextMenuService = [ { label: 'Service Menu', command: (event) => this.closeContextMenu() }, { label: 'View this Service', icon: 'fa-plus', command: (event) => this.viewInfo() }, - { label: 'Add sensor', icon: 'fa-plus', command: (event) => this.addSensor() }, + { label: 'Add sensor', icon: 'fa-plus', command: (event) => this.addSensorWithTarget() }, ]; this.contextMenuSensor = [ { label: 'Sensor Menu', command: (event) => this.closeContextMenu() }, - { label: 'Edit', icon: 'fa-plus', command: (event) => this.viewInfo() }, - { label: 'Remove', icon: 'fa-plus', command: (event) => this.addSensor() }, + { label: 'View this Sensor', icon: 'fa-plus', command: (event) => this.viewInfo() }, + { label: 'Edit', icon: 'fa-plus', command: (event) => this.editSensor() }, + { label: 'Remove', icon: 'fa-plus', command: (event) => this.removeSensor() }, ]; } @@ -430,6 +433,7 @@ export class MapComponent implements OnInit, AfterContentInit { if (nodeType === 'probe') { this.router.navigate(['probe', event.node.obj.id, 'info']); } else if (nodeType === 'host') { + } } @@ -463,8 +467,33 @@ export class MapComponent implements OnInit, AfterContentInit { return false; } - addSensor() { - alert('으악 내일 할래'); + testTraceroute() { + } + + testARP() { + } + + testPing() { + } + + editProbeAlias() { + } + + editSensor() { + } + + removeSensor() { + } + + discovery() { + } + + addSensorWithTarget() { + this.sensorSettingDisplay = true; + } + + onSensorSettingClose() { + this.sensorSettingDisplay = false; } } diff --git a/src/packages/infra/infra.module.ts b/src/packages/infra/infra.module.ts index c9e458b..18f0f63 100644 --- a/src/packages/infra/infra.module.ts +++ b/src/packages/infra/infra.module.ts @@ -7,6 +7,7 @@ import { FormsModule } from '@angular/forms'; import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module'; import { DiscoveryModule } from 'packages/discovery/discovery.module'; import { SensorModule } from '../sensor/sensor.module'; +import { KeyValueModule } from 'app/commons/component/key-value/key-value.module'; @NgModule({ @@ -16,7 +17,8 @@ import { SensorModule } from '../sensor/sensor.module'; FormsModule, PrimeNGModules, DiscoveryModule, - SensorModule + SensorModule, + KeyValueModule ], declarations: [ COMPONENTS, diff --git a/src/packages/infra/model/InfraHost.ts b/src/packages/infra/model/InfraHost.ts index 272fad7..8558ed0 100644 --- a/src/packages/infra/model/InfraHost.ts +++ b/src/packages/infra/model/InfraHost.ts @@ -4,7 +4,8 @@ import { Infra } from './Infra'; export interface InfraHost extends Infra { // id?: number; os?: InfraOS; - ip?: number; + ipv4?: number; + ipv6?: number; mac?: number; createDate?: Date; } diff --git a/src/packages/probe/component/list/list.component.html b/src/packages/probe/component/list/list.component.html index bf8f47a..84bb8c1 100644 --- a/src/packages/probe/component/list/list.component.html +++ b/src/packages/probe/component/list/list.component.html @@ -12,13 +12,12 @@ - + {{probeHost.probe.displayName}} - - ? - ? + {{probeHost.host.ipv4}} + {{probeHost.host.os.vendor.name}} {{probeHost.probe.cidr}} - ?? + 반정규화 필요 {{probeHost.probe.authorizeDate | date: 'dd.MM.yyyy'}} {{probeHost.probe.authorizeMember.name}} diff --git a/src/packages/probe/component/list/list.component.ts b/src/packages/probe/component/list/list.component.ts index 8b2f5eb..b1047b9 100644 --- a/src/packages/probe/component/list/list.component.ts +++ b/src/packages/probe/component/list/list.component.ts @@ -50,6 +50,6 @@ export class ListComponent implements OnInit, AfterContentInit { } onRowSelect(event) { - this.router.navigate(['probe', event.data.id, 'info']); + this.router.navigate(['probe', event.data.probe.id, 'info']); } }