add inframap
This commit is contained in:
parent
a35945e010
commit
aacd439d04
@ -52,8 +52,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<p-footer>
|
<p-footer>
|
||||||
<button pButton type="button" label="Save" icon="fa-check"></button>
|
<!-- <button pButton type="button" label="Cancel" icon="fa-close" class="ui-button-secondary" (click)="display=false"></button> -->
|
||||||
<button pButton type="button" label="Cancel" icon="fa-close" class="ui-button-secondary"></button>
|
<button pButton type="button" label="Start" icon="fa-check" (click)="discovery()"></button>
|
||||||
</p-footer>
|
</p-footer>
|
||||||
</p-card>
|
</p-card>
|
||||||
|
|
||||||
@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p-footer>
|
<p-footer>
|
||||||
<button pButton type="button" label="Save" icon="fa-check"></button>
|
<button pButton type="button" label="Save" icon="fa-check"></button>
|
||||||
<button pButton type="button" label="Cancel" icon="fa-close" class="ui-button-secondary"></button>
|
<!-- <button pButton type="button" label="Cancel" icon="fa-close" class="ui-button-secondary"></button> -->
|
||||||
</p-footer>
|
</p-footer>
|
||||||
</p-card>
|
</p-card>
|
||||||
|
|
||||||
|
@ -102,39 +102,39 @@ export class SettingComponent implements OnInit, AfterContentInit {
|
|||||||
|
|
||||||
this.treeNodes = this.convertViewHost(this.testObj);
|
this.treeNodes = this.convertViewHost(this.testObj);
|
||||||
|
|
||||||
this.settingSucceed$.subscribe(
|
// this.settingSucceed$.subscribe(
|
||||||
(succeed: boolean) => {
|
// (succeed: boolean) => {
|
||||||
if (succeed) {
|
// if (succeed) {
|
||||||
this.started = true;
|
// this.started = true;
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
(error: RPCClientError) => {
|
// (error: RPCClientError) => {
|
||||||
console.log(error.response.message);
|
// console.log(error.response.message);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
|
|
||||||
this.probe$.subscribe(
|
// this.probe$.subscribe(
|
||||||
(probe: Probe) => {
|
// (probe: Probe) => {
|
||||||
if (probe != null) {
|
// if (probe != null) {
|
||||||
this.probe = probe;
|
// this.probe = probe;
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
(error: RPCClientError) => {
|
// (error: RPCClientError) => {
|
||||||
console.log(error.response.message);
|
// console.log(error.response.message);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
|
|
||||||
this.discoveryResult$.subscribe(
|
// this.discoveryResult$.subscribe(
|
||||||
(zones: Map<string, Zone>) => {
|
// (zones: Map<string, Zone>) => {
|
||||||
console.log('ZoneZoneZoneZoneZoneZoneZone');
|
// console.log('ZoneZoneZoneZoneZoneZoneZone');
|
||||||
// console.log(JSON.stringify(zones));
|
// // console.log(JSON.stringify(zones));
|
||||||
this.convertTreeViewZone(zones);
|
// this.convertTreeViewZone(zones);
|
||||||
this.zones = zones;
|
// this.zones = zones;
|
||||||
},
|
// },
|
||||||
(error: RPCClientError) => {
|
// (error: RPCClientError) => {
|
||||||
console.log(error.response.message);
|
// console.log(error.response.message);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,41 +190,41 @@ export class SettingComponent implements OnInit, AfterContentInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
discovery() {
|
discovery() {
|
||||||
let discoveryPort: DiscoveryPort = null;
|
// let discoveryPort: DiscoveryPort = null;
|
||||||
let discoveryService: DiscoveryService = null;
|
// let discoveryService: DiscoveryService = null;
|
||||||
|
|
||||||
if (this.serviceChecked) {
|
// if (this.serviceChecked) {
|
||||||
const services = new Array();
|
// const services = new Array();
|
||||||
for (const service of this.includeServices) {
|
// for (const service of this.includeServices) {
|
||||||
services.push(service.name);
|
// services.push(service.name);
|
||||||
}
|
// }
|
||||||
discoveryService = {
|
// discoveryService = {
|
||||||
includeServices: services,
|
// includeServices: services,
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
if (this.portChecked) {
|
// if (this.portChecked) {
|
||||||
discoveryPort = {
|
// discoveryPort = {
|
||||||
firstScanRange: this.startPort,
|
// firstScanRange: this.startPort,
|
||||||
lastScanRange: this.endPort,
|
// lastScanRange: this.endPort,
|
||||||
includeTCP: this.tcpChecked,
|
// includeTCP: this.tcpChecked,
|
||||||
includeUDP: this.udpChecked,
|
// includeUDP: this.udpChecked,
|
||||||
excludePorts: null,
|
// excludePorts: null,
|
||||||
discoveryService: discoveryService
|
// discoveryService: discoveryService
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
const discoveryZone: DiscoveryZone = {
|
// const discoveryZone: DiscoveryZone = {
|
||||||
discoveryHost: {
|
// discoveryHost: {
|
||||||
firstScanRange: this.startIP,
|
// firstScanRange: this.startIP,
|
||||||
lastScanRange: this.endIP,
|
// lastScanRange: this.endIP,
|
||||||
discoveryPort: discoveryPort,
|
// discoveryPort: discoveryPort,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
|
|
||||||
console.log(discoveryZone);
|
// console.log(discoveryZone);
|
||||||
|
|
||||||
console.log('start discovery - ' + this.probe.probeKey);
|
// console.log('start discovery - ' + this.probe.probeKey);
|
||||||
this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
|
// this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
|
||||||
{ probeID: this.probe.probeKey, discoveryZone: discoveryZone }));
|
// { probeID: this.probe.probeKey, discoveryZone: discoveryZone }));
|
||||||
|
|
||||||
this.started = true;
|
this.started = true;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,38 @@
|
|||||||
<div>map</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
<p-dialog header="Discovery" [width]="700" [(visible)]="display">
|
||||||
|
<of-discovery-setting></of-discovery-setting>
|
||||||
|
</p-dialog>
|
||||||
|
|
||||||
|
<button type="text" (click)="showDialog()" pButton icon="fa-external-link-square" label="Show"></button>
|
||||||
|
|
||||||
|
|
||||||
|
<p-tree [value]="infraTree" [style]="{width: '360px'}" selectionMode="single" [(selection)]="selectedTree" ></p-tree>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <div fxLayoutAlign="end" [style.margin]="'10px 10px'">
|
<!-- <div fxLayoutAlign="end" [style.margin]="'10px 10px'">
|
||||||
<form class="form">
|
<form class="form">
|
||||||
<mat-form-field class="full-width">
|
<mat-form-field class="full-width">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Component, OnInit, AfterViewInit, AfterContentInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, AfterViewInit, AfterContentInit, ViewChild } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { TreeNode } from 'primeng/primeng';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-infra-map',
|
selector: 'of-infra-map',
|
||||||
@ -7,6 +8,10 @@ import { Router } from '@angular/router';
|
|||||||
})
|
})
|
||||||
export class MapComponent implements OnInit, AfterContentInit {
|
export class MapComponent implements OnInit, AfterContentInit {
|
||||||
|
|
||||||
|
infraTree: TreeNode[] = testInfraList;
|
||||||
|
|
||||||
|
display = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
) {
|
) {
|
||||||
@ -18,4 +23,155 @@ export class MapComponent implements OnInit, AfterContentInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showDialog() {
|
||||||
|
this.display = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const testInfraList = [{
|
||||||
|
label: 'Infra',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Zone - 192.168.1.0/24',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Host - 192.168.1.106 - Snoop Host',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - WMI, SSH, SNMP',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - FTP(21)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - FTP, Sensor',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Host - 192.168.1.103 - Geek Host',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - WMI, SSH, SNMP',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - MySQL(3306)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - MySQL, PING',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - PostgreSQL(5555)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - PostgreSQL, PING',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Zone - 192.168.10.0/24',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Host - 192.168.10.106 - Snoop Host',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - WMI, SSH, SNMP',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - FTP(21)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - FTP, Sensor',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Host - 192.168.10.103 - Geek Host',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - WMI, SSH, SNMP',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - MySQL(3306)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - MySQL, PING',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Service - PostgreSQL(5555)',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
children: [{
|
||||||
|
label: 'Sensors - PostgreSQL, PING',
|
||||||
|
expandedIcon: 'fa-folder-open',
|
||||||
|
collapsedIcon: 'fa-folder',
|
||||||
|
expanded : true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
}],
|
||||||
|
}],
|
||||||
|
}];
|
||||||
|
@ -5,6 +5,8 @@ import { COMPONENTS } from './component';
|
|||||||
import { SERVICES } from './service';
|
import { SERVICES } from './service';
|
||||||
import { FormsModule } from '@angular/forms';
|
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';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -12,6 +14,7 @@ import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
|||||||
InfraStoreModule,
|
InfraStoreModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
PrimeNGModules,
|
PrimeNGModules,
|
||||||
|
DiscoveryModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
COMPONENTS,
|
COMPONENTS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user