probe error fix

This commit is contained in:
insanity 2018-04-26 20:23:57 +09:00
parent 3ac55a528e
commit e357030fe8
8 changed files with 64 additions and 29 deletions

View File

@ -5,9 +5,9 @@
export const environment = { export const environment = {
production: false, production: false,
restBaseURL: 'http://192.168.1.50:19080/webapp', restBaseURL: 'http://192.168.1.103:19080/webapp',
webappRPCConfig: { webappRPCConfig: {
url: 'ws://192.168.1.50:19090/webapp', url: 'ws://192.168.1.103:19090/webapp',
reconnectInterval: 5000, reconnectInterval: 5000,
reconnectRetry: 10, reconnectRetry: 10,
}, },

View File

@ -1,5 +1,5 @@
<div *ngIf="host"> <div *ngIf="host">
<b>{{ host.ip }}</b> <of-key-value [key]="'IP'" [value]="host.ipv4"></of-key-value>
<b>{{ host.mac }}</b> <of-key-value [key]="'Mac'" [value]="host.mac"></of-key-value>
<b>{{ host.os.vendor.name }}</b> <of-key-value [key]="'OS'" [value]="host.os.vendor.name"></of-key-value>
</div> </div>

View File

@ -61,7 +61,7 @@
<p-contextMenu #cmService [model]="contextMenuService"></p-contextMenu> <p-contextMenu #cmService [model]="contextMenuService"></p-contextMenu>
<p-contextMenu #cmSensor [model]="contextMenuSensor"></p-contextMenu> <p-contextMenu #cmSensor [model]="contextMenuSensor"></p-contextMenu>
<p-sidebar [(visible)]="visibleSidebar" position="bottom" [baseZIndex]="10000" *ngIf="selectedNode"> <p-sidebar [(visible)]="visibleSidebar" position="bottom" [baseZIndex]="10000" *ngIf="selectedNode" styleClass="ui-sidebar-md">
<div *ngIf="selectedNode.type === 'probe'"> <div *ngIf="selectedNode.type === 'probe'">
<of-probe-summary [probe]="targetNodeForView" [visible]="visibleSidebar"></of-probe-summary> <of-probe-summary [probe]="targetNodeForView" [visible]="visibleSidebar"></of-probe-summary>
</div> </div>
@ -73,6 +73,10 @@
</div> </div>
</p-sidebar> </p-sidebar>
<p-dialog [modal]="true" [width]="800" [(visible)]="sensorSettingDisplay" [showHeader]="true" [closeOnEscape]="false">
<of-sensor-setting [visible]="sensorSettingDisplay" [preTarget]="targetNodeForView" (close)="onSensorSettingClose()"></of-sensor-setting>
</p-dialog>

View File

@ -68,6 +68,8 @@ export class MapComponent implements OnInit, AfterContentInit {
selectedNode: TreeNode = null; selectedNode: TreeNode = null;
targetNodeForView: Object = null; targetNodeForView: Object = null;
sensorSettingDisplay = false;
constructor(private router: Router, constructor(private router: Router,
private listStore: Store<ListStore.State>, private listStore: Store<ListStore.State>,
private sensorListStore: Store<SensorListStore.State> private sensorListStore: Store<SensorListStore.State>
@ -80,7 +82,7 @@ export class MapComponent implements OnInit, AfterContentInit {
const pageParams: PageParams = { const pageParams: PageParams = {
pageNo: '0', pageNo: '0',
countPerPage: '10', countPerPage: '99999',
sortCol: 'id', sortCol: 'id',
sortDirection: 'descending' sortDirection: 'descending'
}; };
@ -91,8 +93,9 @@ export class MapComponent implements OnInit, AfterContentInit {
console.log(error); console.log(error);
} }
); );
}
ngOnInit() {
this.infras$.subscribe( this.infras$.subscribe(
(page: Page) => { (page: Page) => {
console.log(page); console.log(page);
@ -118,34 +121,34 @@ export class MapComponent implements OnInit, AfterContentInit {
console.log(error.response.message); console.log(error.response.message);
} }
); );
}
ngOnInit() {
this.initContextMenu(); this.initContextMenu();
} }
initContextMenu() { initContextMenu() {
this.contextMenuProbe = [ this.contextMenuProbe = [
{ label: 'Probe Menu', command: (event) => this.closeContextMenu() }, { 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 = [ this.contextMenuHost = [
{ label: 'Host Menu', command: (event) => this.closeContextMenu() }, { label: 'Host Menu', command: (event) => this.closeContextMenu() },
{ label: 'View this Host', icon: 'fa-plus', command: (event) => this.viewInfo() }, { label: 'View this Host', 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() },
{ label: 'Traceroute', icon: 'fa-plus' }, { label: 'Traceroute', icon: 'fa-plus', command: (event) => this.testTraceroute() },
{ label: 'ARP Test', icon: 'fa-plus' }, { label: 'ARP Test', icon: 'fa-plus', command: (event) => this.testARP() },
{ label: 'Ping Test', icon: 'fa-plus' }, { label: 'Ping Test', icon: 'fa-plus', command: (event) => this.testPing() },
]; ];
this.contextMenuService = [ this.contextMenuService = [
{ label: 'Service Menu', command: (event) => this.closeContextMenu() }, { label: 'Service Menu', command: (event) => this.closeContextMenu() },
{ label: 'View this Service', icon: 'fa-plus', command: (event) => this.viewInfo() }, { 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 = [ this.contextMenuSensor = [
{ label: 'Sensor Menu', command: (event) => this.closeContextMenu() }, { label: 'Sensor Menu', command: (event) => this.closeContextMenu() },
{ label: 'Edit', icon: 'fa-plus', command: (event) => this.viewInfo() }, { label: 'View this Sensor', icon: 'fa-plus', command: (event) => this.viewInfo() },
{ label: 'Remove', icon: 'fa-plus', command: (event) => this.addSensor() }, { 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') { if (nodeType === 'probe') {
this.router.navigate(['probe', event.node.obj.id, 'info']); this.router.navigate(['probe', event.node.obj.id, 'info']);
} else if (nodeType === 'host') { } else if (nodeType === 'host') {
} }
} }
@ -463,8 +467,33 @@ export class MapComponent implements OnInit, AfterContentInit {
return false; return false;
} }
addSensor() { testTraceroute() {
alert('으악 내일 할래'); }
testARP() {
}
testPing() {
}
editProbeAlias() {
}
editSensor() {
}
removeSensor() {
}
discovery() {
}
addSensorWithTarget() {
this.sensorSettingDisplay = true;
}
onSensorSettingClose() {
this.sensorSettingDisplay = false;
} }
} }

View File

@ -7,6 +7,7 @@ import { FormsModule } from '@angular/forms';
import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module'; import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
import { DiscoveryModule } from 'packages/discovery/discovery.module'; import { DiscoveryModule } from 'packages/discovery/discovery.module';
import { SensorModule } from '../sensor/sensor.module'; import { SensorModule } from '../sensor/sensor.module';
import { KeyValueModule } from 'app/commons/component/key-value/key-value.module';
@NgModule({ @NgModule({
@ -16,7 +17,8 @@ import { SensorModule } from '../sensor/sensor.module';
FormsModule, FormsModule,
PrimeNGModules, PrimeNGModules,
DiscoveryModule, DiscoveryModule,
SensorModule SensorModule,
KeyValueModule
], ],
declarations: [ declarations: [
COMPONENTS, COMPONENTS,

View File

@ -4,7 +4,8 @@ import { Infra } from './Infra';
export interface InfraHost extends Infra { export interface InfraHost extends Infra {
// id?: number; // id?: number;
os?: InfraOS; os?: InfraOS;
ip?: number; ipv4?: number;
ipv6?: number;
mac?: number; mac?: number;
createDate?: Date; createDate?: Date;
} }

View File

@ -12,13 +12,12 @@
</tr> </tr>
</ng-template> </ng-template>
<ng-template pTemplate="body" let-probeHost> <ng-template pTemplate="body" let-probeHost>
<tr [pSelectableRow]="probe"> <tr [pSelectableRow]="probeHost">
<td>{{probeHost.probe.displayName}}</td> <td>{{probeHost.probe.displayName}}</td>
<!-- <td>{{probeHost.host.os.vendor.name}}</td> --> <td>{{probeHost.host.ipv4}}</td>
<td>?</td> <td>{{probeHost.host.os.vendor.name}}</td>
<td>?</td>
<td>{{probeHost.probe.cidr}}</td> <td>{{probeHost.probe.cidr}}</td>
<td>??</td> <td>반정규화 필요</td>
<td>{{probeHost.probe.authorizeDate | date: 'dd.MM.yyyy'}}</td> <td>{{probeHost.probe.authorizeDate | date: 'dd.MM.yyyy'}}</td>
<td>{{probeHost.probe.authorizeMember.name}}</td> <td>{{probeHost.probe.authorizeMember.name}}</td>
</tr> </tr>

View File

@ -50,6 +50,6 @@ export class ListComponent implements OnInit, AfterContentInit {
} }
onRowSelect(event) { onRowSelect(event) {
this.router.navigate(['probe', event.data.id, 'info']); this.router.navigate(['probe', event.data.probe.id, 'info']);
} }
} }