diff --git a/src/app/pages/home/home-page.component.html b/src/app/pages/home/home-page.component.html
index 811c037..4c2c481 100644
--- a/src/app/pages/home/home-page.component.html
+++ b/src/app/pages/home/home-page.component.html
@@ -1 +1,8 @@
-
home works
\ No newline at end of file
+home works
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts
index 3701a1c..ee020a5 100644
--- a/src/app/pages/home/home-page.component.ts
+++ b/src/app/pages/home/home-page.component.ts
@@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
+import {DialogModule} from 'primeng/dialog';
+import { SettingComponent as DiscoverySettingComponent } from 'packages/discovery/component/setting/setting.component';
+
@Component({
selector: 'of-pages-home',
@@ -6,9 +9,17 @@ import { Component, OnInit } from '@angular/core';
})
export class HomePageComponent implements OnInit {
+ display = false;
+
constructor() { }
ngOnInit() {
}
+
+
+ showDialog() {
+ this.display = true;
+ }
+
}
diff --git a/src/app/pages/home/home-page.module.ts b/src/app/pages/home/home-page.module.ts
index f6a9eeb..36f115a 100644
--- a/src/app/pages/home/home-page.module.ts
+++ b/src/app/pages/home/home-page.module.ts
@@ -3,11 +3,19 @@ import { CommonModule } from '@angular/common';
import { HomePageComponent } from './home-page.component';
import { HomePageRoutingModule } from './home-page-routing.module';
+import { PrimeNGModules } from 'packages/commons/prime-ng/prime-ng.module';
+import { SettingComponent as DiscoverySettingComponent } from 'packages/discovery/component/setting/setting.component';
+import { DiscoveryModule } from 'packages/discovery/discovery.module';
@NgModule({
imports: [
CommonModule,
HomePageRoutingModule,
+ PrimeNGModules,
+ DiscoveryModule
+ ],
+ entryComponents: [
+ DiscoverySettingComponent
],
declarations: [HomePageComponent]
})
diff --git a/src/packages/commons/prime-ng/prime-ng.module.ts b/src/packages/commons/prime-ng/prime-ng.module.ts
index 6726477..6de4f7e 100644
--- a/src/packages/commons/prime-ng/prime-ng.module.ts
+++ b/src/packages/commons/prime-ng/prime-ng.module.ts
@@ -66,6 +66,8 @@ import { ToolbarModule } from 'primeng/primeng';
import { TooltipModule } from 'primeng/primeng';
import { TreeModule } from 'primeng/primeng';
import { TreeTableModule } from 'primeng/primeng';
+import {CardModule} from 'primeng/card';
+
const PRIME_NG_MODULES: any[] = [
AccordionModule,
@@ -134,7 +136,8 @@ const PRIME_NG_MODULES: any[] = [
ToolbarModule,
TooltipModule,
TreeModule,
- TreeTableModule
+ TreeTableModule,
+ CardModule
];
@NgModule({
diff --git a/src/packages/discovery/component/index.ts b/src/packages/discovery/component/index.ts
index 733eb6b..81ac9cc 100644
--- a/src/packages/discovery/component/index.ts
+++ b/src/packages/discovery/component/index.ts
@@ -1,5 +1,5 @@
-// import { SettingComponent } from './setting/setting.component';
+import { SettingComponent } from './setting/setting.component';
-// export const COMPONENTS = [
-// SettingComponent,
-// ];
+export const COMPONENTS = [
+ SettingComponent,
+];
diff --git a/src/packages/discovery/component/setting/setting.component.html b/src/packages/discovery/component/setting/setting.component.html
index e72a586..f90d174 100644
--- a/src/packages/discovery/component/setting/setting.component.html
+++ b/src/packages/discovery/component/setting/setting.component.html
@@ -1,85 +1,92 @@
-
Discovery Setting
-
-
-
-
-
- Zone
- {{cidr}}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
- {{ node.data.title }}
-
-
+
+
+
+
+
+
+
+
Selected Nodes:
+ {{file.label}}
-
-
-
+
+
+
+
+
+
+
+
+
-
+ -->
\ No newline at end of file
diff --git a/src/packages/discovery/component/setting/setting.component.ts b/src/packages/discovery/component/setting/setting.component.ts
index 93c06ab..e16a4ec 100644
--- a/src/packages/discovery/component/setting/setting.component.ts
+++ b/src/packages/discovery/component/setting/setting.component.ts
@@ -1,182 +1,174 @@
-// import { Component, OnInit, AfterContentInit } from '@angular/core';
-// import { Store, select } from '@ngrx/store';
-// import { RPCClientError } from '@loafer/ng-rpc/protocol';
-// import {
-// DiscoveryStartInfo,
-// DiscoveryZone,
-// Zone,
-// DiscoveryPort,
-// DiscoveryService
-// } from '../../model';
-// import * as CIDR from 'ip-cidr';
-// import * as DiscoveredStore from '../../store/setting';
-// // import * as DiscoverStore from '../../store/discover';
-
-// import { SettingSelector, DiscoverSelector } from '../../store';
+import { Component, OnInit, AfterContentInit } from '@angular/core';
+import { Store, select } from '@ngrx/store';
+import { RPCClientError } from '@loafer/ng-rpc/protocol';
+import {
+ DiscoveryStartInfo,
+ DiscoveryZone,
+ Zone,
+ DiscoveryPort,
+ DiscoveryService
+} from '../../model';
+import * as CIDR from 'ip-cidr';
+import * as DiscoveredStore from '../../store/setting';
// import * as DiscoverStore from '../../store/discover';
-// import * as RegistStore from '../../store/regist';
-// import { Host } from 'packages/discovery/model/Host';
-// import { Port } from 'packages/discovery/model/Port';
-// import { Service } from 'packages/discovery/model/Service';
-// import * as ProbeDetailStore from 'packages/probe/store';
-// import { Probe } from 'packages/probe/model';
+import { SettingSelector, DiscoverSelector } from '../../store';
+import * as DiscoverStore from '../../store/discover';
-// import { DetailSelector as ProbeDetailSelector } from 'packages/probe/store';
+import * as RegistStore from '../../store/regist';
+import { Host } from 'packages/discovery/model/Host';
+import { Port } from 'packages/discovery/model/Port';
+import { Service } from 'packages/discovery/model/Service';
+import * as ProbeDetailStore from 'packages/probe/store';
+import { Probe } from 'packages/probe/model';
-// @Component({
-// selector: 'of-setting',
-// templateUrl: './setting.component.html',
-// styleUrls: ['./setting.component.scss']
-// })
-// export class SettingComponent implements OnInit, AfterContentInit {
+import { DetailSelector as ProbeDetailSelector } from 'packages/probe/store';
+import { TreeNode } from 'primeng/primeng';
+// import { TreeNode } from 'angular-tree-component';
+
+@Component({
+ selector: 'of-discovery-setting',
+ templateUrl: './setting.component.html',
+ styleUrls: ['./setting.component.scss']
+})
+export class SettingComponent implements OnInit, AfterContentInit {
-// probe$ = this.probeDetailStore.pipe(select(ProbeDetailSelector.select('probe')));
+ probe$ = this.probeDetailStore.pipe(select(ProbeDetailSelector.select('probe')));
-// settingSucceed$: any;
-// discoveryResult$: any;
-// probe: Probe = null;
-// started = false;
+ settingSucceed$: any;
+ discoveryResult$: any;
+ probe: Probe = null;
+ started = false;
-// cidr;
-// startIP;
-// endIP;
-// startPort;
-// endPort;
-// // private settingForm: FormGroup;
-// hostChecked = true;
-// portChecked = true;
-// serviceChecked = true;
-// tcpChecked = true;
-// udpChecked = true;
-// includeServices = null;
+ cidr;
+ startIP;
+ endIP;
+ startPort;
+ endPort;
+ // private settingForm: FormGroup;
+ hostChecked = true;
+ portChecked = true;
+ serviceChecked = true;
+ tcpChecked = true;
+ udpChecked = true;
+ includeServices = null;
-// serviceItems = [
-// { name: 'SSH' },
-// { name: 'PostgreSQL' },
-// { name: 'DNS' },
-// { name: 'WMI'},
-// { name: 'SMB' },
-// { name: 'ActiveDirectory' },
-// { name: 'Cassandra' },
-// { name: 'FTP' },
-// { name: 'HTTP' },
-// { name: 'IMAP' },
-// { name: 'LDAP' },
-// { name: 'MongoDB' },
-// { name: 'MySQL' },
-// { name: 'NBSS' },
-// ];
+ serviceItems = [
+ { name: 'SSH' },
+ { name: 'PostgreSQL' },
+ { name: 'DNS' },
+ { name: 'WMI'},
+ { name: 'SMB' },
+ { name: 'ActiveDirectory' },
+ { name: 'Cassandra' },
+ { name: 'FTP' },
+ { name: 'HTTP' },
+ { name: 'IMAP' },
+ { name: 'LDAP' },
+ { name: 'MongoDB' },
+ { name: 'MySQL' },
+ { name: 'NBSS' },
+ ];
-// treeNodes = [];
-// zones: Map = null;
+ cities = [
+ {name: 'New York', code: 'NY'},
+ {name: 'Rome', code: 'RM'},
+ {name: 'London', code: 'LDN'},
+ {name: 'Istanbul', code: 'IST'},
+ {name: 'Paris', code: 'PRS'}
+];
-// checkedSet = new Set();
+ treeNodes = [];
+ zones: Map = null;
-// constructor(
-// private discoverdstore: Store,
-// private discoverstore: Store,
-// private registStore: Store,
-// private probeDetailStore: Store
-// ) {
-// this.settingSucceed$ = discoverdstore.pipe(select(SettingSelector.select('isStart')));
-// this.discoveryResult$ = this.discoverstore.pipe(select(DiscoverSelector.select('zones')));
-// }
+ checkedSet = new Set();
-// ngOnInit() {
-// this.settingSucceed$.subscribe(
-// (succeed: boolean) => {
-// if (succeed) {
-// this.started = true;
-// }
-// },
-// (error: RPCClientError) => {
-// console.log(error.response.message);
-// }
-// );
+// treeNodes: TreeNode[] = [];
+ testObj: any[] = testDiscovery;
+ selectedDiscoveryResult: TreeNode[];
-// this.probe$.subscribe(
-// (probe: Probe) => {
-// if (probe != null) {
-// this.probe = probe;
-// }
-// },
-// (error: RPCClientError) => {
-// console.log(error.response.message);
-// }
-// );
+ constructor(
+ private discoverdstore: Store,
+ private discoverstore: Store,
+ private registStore: Store,
+ private probeDetailStore: Store
+ ) {
+ this.settingSucceed$ = discoverdstore.pipe(select(SettingSelector.select('isStart')));
+ this.discoveryResult$ = this.discoverstore.pipe(select(DiscoverSelector.select('zones')));
+ }
-// this.discoveryResult$.subscribe(
-// (zones: Map) => {
-// console.log('ZoneZoneZoneZoneZoneZoneZone');
-// // console.log(JSON.stringify(zones));
-// this.convertTreeViewZone(zones);
-// this.zones = zones;
-// },
-// (error: RPCClientError) => {
-// console.log(error.response.message);
-// }
-// );
+ ngOnInit() {
-// }
+ this.treeNodes = this.convertViewHost(this.testObj);
-// isZone(zone: Zone): boolean {
+ this.settingSucceed$.subscribe(
+ (succeed: boolean) => {
+ if (succeed) {
+ this.started = true;
+ }
+ },
+ (error: RPCClientError) => {
+ console.log(error.response.message);
+ }
+ );
-// for (let i = 0; i < this.treeNodes.length; ++i) {
-// if (zone.iface === this.treeNodes[i].iface) {
-// return true;
-// }
-// }
+ this.probe$.subscribe(
+ (probe: Probe) => {
+ if (probe != null) {
+ this.probe = probe;
+ }
+ },
+ (error: RPCClientError) => {
+ console.log(error.response.message);
+ }
+ );
-// return false;
-// }
+ this.discoveryResult$.subscribe(
+ (zones: Map) => {
+ console.log('ZoneZoneZoneZoneZoneZoneZone');
+ // console.log(JSON.stringify(zones));
+ this.convertTreeViewZone(zones);
+ this.zones = zones;
+ },
+ (error: RPCClientError) => {
+ console.log(error.response.message);
+ }
+ );
-// convertTreeViewZone(zones: Map) {
+ }
-// if (zones === undefined || zones === null) {
-// return;
-// }
+ isZone(zone: Zone): boolean {
-// // console.log('convertTreeViewZone');
-// const treeNodes: any[] = [];
+ for (let i = 0; i < this.treeNodes.length; ++i) {
+ if (zone.iface === this.treeNodes[i].iface) {
+ return true;
+ }
+ }
-// zones.forEach((value: Zone, key: string, map) => {
-// if (this.isZone(value)) {
-// return;
-// }
-// const jZone: any = {
-// title: 'Zone - ' + value.iface,
-// className: 'cn' + value.ip
-// };
-// jZone.obj = value;
-// jZone.children = this.convertViewHost(value.hosts);
-// treeNodes.push(jZone);
-// });
+ return false;
+ }
-// this.treeNodes = treeNodes;
-// }
+ ngAfterContentInit() {
+ this.cidr = '192.168.1.0/24';
+ this.hostRange();
+ this.portRange();
+ }
-// ngAfterContentInit() {
-// this.cidr = '192.168.1.0/24';
-// this.hostRange();
-// this.portRange();
-// }
+ hostRange() {
+ const cidr = new CIDR(this.cidr);
+ if (!cidr.isValid()) {
+ alert('Invalid cidr : ' + this.cidr);
+ return;
+ }
+ this.startIP = cidr.addressStart.address;
+ this.endIP = cidr.addressEnd.address;
+ }
-// hostRange() {
-// const cidr = new CIDR(this.cidr);
-// if (!cidr.isValid()) {
-// alert('Invalid cidr : ' + this.cidr);
-// return;
-// }
-// this.startIP = cidr.addressStart.address;
-// this.endIP = cidr.addressEnd.address;
-// }
-
-// portRange() {
-// this.startPort = '1';
-// this.endPort = '1024';
-// }
+ portRange() {
+ this.startPort = '1';
+ this.endPort = '1024';
+ }
// handleHostCheckChange(e: MatCheckboxChange) {
// this.hostChecked = true;
@@ -193,200 +185,565 @@
// }
// }
-// handleServiceChange(list: any) {
-// this.includeServices = list;
-// }
+ handleServiceChange(list: any) {
+ this.includeServices = list;
+ }
-// discovery() {
-// let discoveryPort: DiscoveryPort = null;
-// let discoveryService: DiscoveryService = null;
+ discovery() {
+ let discoveryPort: DiscoveryPort = null;
+ let discoveryService: DiscoveryService = null;
-// if (this.serviceChecked) {
-// const services = new Array();
-// for (const service of this.includeServices) {
-// services.push(service.name);
-// }
-// discoveryService = {
-// includeServices: services,
-// };
-// }
-// if (this.portChecked) {
-// discoveryPort = {
-// firstScanRange: this.startPort,
-// lastScanRange: this.endPort,
-// includeTCP: this.tcpChecked,
-// includeUDP: this.udpChecked,
-// excludePorts: null,
-// discoveryService: discoveryService
-// };
-// }
-// const discoveryZone: DiscoveryZone = {
-// discoveryHost: {
-// firstScanRange: this.startIP,
-// lastScanRange: this.endIP,
-// discoveryPort: discoveryPort,
-// },
-// };
+ if (this.serviceChecked) {
+ const services = new Array();
+ for (const service of this.includeServices) {
+ services.push(service.name);
+ }
+ discoveryService = {
+ includeServices: services,
+ };
+ }
+ if (this.portChecked) {
+ discoveryPort = {
+ firstScanRange: this.startPort,
+ lastScanRange: this.endPort,
+ includeTCP: this.tcpChecked,
+ includeUDP: this.udpChecked,
+ excludePorts: null,
+ discoveryService: discoveryService
+ };
+ }
+ const discoveryZone: DiscoveryZone = {
+ discoveryHost: {
+ firstScanRange: this.startIP,
+ lastScanRange: this.endIP,
+ discoveryPort: discoveryPort,
+ },
+ };
-// console.log(discoveryZone);
+ console.log(discoveryZone);
-// console.log('start discovery - ' + this.probe.probeKey);
-// this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
-// { probeID: this.probe.probeKey, discoveryZone: discoveryZone }));
+ console.log('start discovery - ' + this.probe.probeKey);
+ this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
+ { probeID: this.probe.probeKey, discoveryZone: discoveryZone }));
-// this.started = true;
-// }
+ this.started = true;
+ }
-// checkDiscoveryResult(node) {
+ checkDiscoveryResult(node) {
-// node.toggleActivated(true);
+ node.toggleActivated(true);
-// if (node.isActive) {
-// if (node.data.obj !== undefined) {
-// node.data.obj.target = true;
-// }
-// } else {
-// if (node.data.obj !== undefined) {
-// node.data.obj.target = false;
-// }
-// }
+ if (node.isActive) {
+ if (node.data.obj !== undefined) {
+ node.data.obj.target = true;
+ }
+ } else {
+ if (node.data.obj !== undefined) {
+ node.data.obj.target = false;
+ }
+ }
-// console.log(this.zones);
+ console.log(this.zones);
-// }
+ }
-// convertMapToList(map: Map): Array {
+ convertMapToList(map: Map): Array {
-// if (undefined === map || null === map || map.size < 0) {
-// return null;
-// }
+ if (undefined === map || null === map || map.size < 0) {
+ return null;
+ }
-// const retArr = new Array();
+ const retArr = new Array();
-// map.forEach((v: any, k: any) => {
-// retArr.push(v);
-// });
+ map.forEach((v: any, k: any) => {
+ retArr.push(v);
+ });
-// return retArr;
-// }
+ return retArr;
+ }
-// discoveryResultSave() {
-// // console.log(this.checkedSet);
+ discoveryResultSave() {
+ // console.log(this.checkedSet);
-// // send discovery save this.zones;
+ // send discovery save this.zones;
-// // this.registStore.dispatch(new DiscoverStore.DiscoverZone(
-// // {probeID: '52abd6fd57e511e7ac52080027658d13', discoveryZone: discoveryZone}));
+ // this.registStore.dispatch(new DiscoverStore.DiscoverZone(
+ // {probeID: '52abd6fd57e511e7ac52080027658d13', discoveryZone: discoveryZone}));
-// this.zones.forEach((zone: Zone, key: string) => {
-// if (zone.hosts !== undefined && zone.hosts !== null && zone.hosts.size > 0) {
-// // FIXME: getHosts
-// const hosts: Host[] = [];
-// zone.hosts.forEach((h: Host, hKey: string) => {
+ this.zones.forEach((zone: Zone, key: string) => {
+ if (zone.hosts !== undefined && zone.hosts !== null && zone.hosts.size > 0) {
+ // FIXME: getHosts
+ const hosts: Host[] = [];
+ zone.hosts.forEach((h: Host, hKey: string) => {
-// // if (h.ports !== undefined && h.ports !== null) {
-// // h.portList = [];
-// // h.ports.forEach((p: Port, pKey: number) => {
+ // if (h.ports !== undefined && h.ports !== null) {
+ // h.portList = [];
+ // h.ports.forEach((p: Port, pKey: number) => {
-// // if (p.services !== undefined && p.services !== null) {
-// // p.serviceList = [];
+ // if (p.services !== undefined && p.services !== null) {
+ // p.serviceList = [];
-// // p.services.forEach((s: Service, sKey: string) => {
-// // p.serviceList.push(s);
-// // });
+ // p.services.forEach((s: Service, sKey: string) => {
+ // p.serviceList.push(s);
+ // });
-// // }
+ // }
-// // h.portList.push(p);
-// // });
-// // }
+ // h.portList.push(p);
+ // });
+ // }
-// hosts.push(h);
-// });
+ hosts.push(h);
+ });
-// if (hosts.length > 0) {
-// const sd: any = { hosts: hosts, probe: { id: 1 } };
-// console.log(JSON.stringify(sd));
-// console.log('--------');
-// this.registStore.dispatch(new RegistStore.DiscoverySaveAllTarget(sd));
-// }
+ if (hosts.length > 0) {
+ const sd: any = { hosts: hosts, probe: { id: 1 } };
+ console.log(JSON.stringify(sd));
+ console.log('--------');
+ this.registStore.dispatch(new RegistStore.DiscoverySaveAllTarget(sd));
+ }
-// }
-// });
-// }
+ }
+ });
+ }
-// convertViewHost(hosts): any[] {
+ handleClick(event) {
+ // console.log(this.filesTree4);
-// if (hosts === undefined || hosts === null) {
-// return null;
-// }
+ this.checkTarget(this.selectedDiscoveryResult);
+
+ console.log(this.testObj);
+
+ }
+
+ checkTarget(treeList: any[]) {
+
+ if (treeList === undefined || treeList === null) {
+ return;
+ }
+
+ for (let i = 0 ; i < treeList.length; ++i) {
+ treeList[i].obj.target = true;
+
+ this.checkTarget(treeList[i].children);
+ }
+
+ }
+
+ convertTreeViewZone(zones: Map) {
+
+ if (zones === undefined || zones === null) {
+ return;
+ }
+
+ // console.log('convertTreeViewZone');
+ const treeNodes: any[] = [];
+
+ zones.forEach((value: Zone, key: string, map) => {
+ if (this.isZone(value)) {
+ return;
+ }
+ const jZone: any = {
+ label: 'Zone - ' + value.iface,
+ // className: 'cn' + value.ip,
+ expandedIcon: 'fa-folder-open',
+ collapsedIcon: 'fa-folder',
+ };
+ jZone.obj = value;
+ jZone.children = this.convertViewHost(value.hosts);
+ treeNodes.push(jZone);
+ });
+
+ this.treeNodes = treeNodes;
+ }
+
+ convertViewHost(hosts): any[] {
+
+ if (hosts === undefined || hosts === null) {
+ return null;
+ }
-// const hostNodes: any[] = [];
+ const hostNodes: any[] = [];
-// hosts.forEach((host, hostKey) => {
+ hosts.forEach((host, hostKey) => {
-// const jHost: any = {
-// title: 'Host - ' + host.ip,
-// className: 'cn' + host.ip
-// };
-// jHost.obj = host;
+ const jHost: any = {
+ label: 'Host - ' + host.ip,
+ // className: 'cn' + host.ip
+ expandedIcon: 'fa-folder-open',
+ collapsedIcon: 'fa-folder',
+ };
+ jHost.obj = host;
-// jHost.children = this.convertViewPort(host.ports);
+ jHost.children = this.convertViewPort(host.ports);
-// hostNodes.push(jHost);
+ hostNodes.push(jHost);
-// });
+ });
-// return hostNodes;
+ return hostNodes;
-// }
+ }
-// convertViewPort(ports): any[] {
+ convertViewPort(ports): any[] {
-// if (ports === undefined || ports === null) {
-// return null;
-// }
+ if (ports === undefined || ports === null || ports.length === undefined) {
+ return null;
+ }
-// const portChildren: any[] = [];
+ const portChildren: any[] = [];
-// ports.forEach((port, portKey) => {
+ ports.forEach((port, portKey) => {
-// const jPort: any = {
-// title: 'Port - ' + port.portNumber,
-// className: 'cn' + port.portNumber,
-// };
-// jPort.obj = port;
+ const jPort: any = {
+ label: 'Port - ' + port.portNumber,
+ // className: 'cn' + port.portNumber,
+ expandedIcon: 'fa-folder-open',
+ collapsedIcon: 'fa-folder',
+ };
+ jPort.obj = port;
-// jPort.children = this.convertViewService(port.services);
+ jPort.children = this.convertViewService(port.services);
-// portChildren.push(jPort);
-// });
+ portChildren.push(jPort);
+ });
-// return portChildren;
-// }
+ return portChildren;
+ }
-// convertViewService(services): any[] {
+ convertViewService(services): any[] {
-// if (services === undefined || services === null || services.size <= 0) {
-// return null;
-// }
+ if (services === undefined || services === null || services.size <= 0) {
+ return null;
+ }
-// const serviceChildren: any[] = [];
+ const serviceChildren: any[] = [];
-// services.forEach((service, serviceKey) => {
-// const jService: any = {
-// title: 'Service - ' + service.serviceName,
-// className: 'cn' + service.serviceName,
-// };
-// jService.obj = service;
+ services.forEach((service, serviceKey) => {
+ const jService: any = {
+ label: 'Service - ' + service.serviceName,
+ // className: 'cn' + service.serviceName,
+ };
+ jService.obj = service;
-// serviceChildren.push(jService);
-// });
+ serviceChildren.push(jService);
+ });
-// return serviceChildren;
-// }
+ return serviceChildren;
+ }
+
+}
+
+
+const testDiscovery: any[] = [
+ {
+ id: 0,
+ ip: '192.168.1.254',
+ mac: '64:e5:99:63:e7:80',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'UDP',
+ portNumber: 53,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: [
+ {
+ id: 0,
+ cryptoType: null,
+ serviceName: 'DNS',
+ discoveredDate: -62135596800000,
+ port: null,
+ target: false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.99',
+ mac: '00:25:b3:fa:ca:9b',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'UDP',
+ portNumber: 161,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: [
+ {
+ id: 0,
+ cryptoType: null,
+ serviceName: 'SNMP_V2',
+ discoveredDate: -62135596800000,
+ port: null,
+ target: false
+ }
+ ]
+ },
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 7,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.206',
+ mac: '30:9c:23:15:a3:09',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: null
+ },
+ {
+ id: 0,
+ ip: '192.168.1.50',
+ mac: '6c:f0:49:7a:60:68',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 22,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: [
+ {
+ id: 0,
+ cryptoType: 'TCP',
+ serviceName: 'SSH',
+ discoveredDate: -62135596800000,
+ port: null,
+ target: false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.15',
+ mac: '00:19:b9:35:8e:a6',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 22,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ },
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 25,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.100',
+ mac: '00:17:08:8d:cf:f7',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'UDP',
+ portNumber: 161,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: [
+ {
+ id: 0,
+ cryptoType: null,
+ serviceName: 'SNMP_V2',
+ discoveredDate: -62135596800000,
+ port: null,
+ target: false
+ }
+ ]
+ },
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 23,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ },
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 21,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.16',
+ mac: '00:19:b9:19:7e:c7',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 22,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.106',
+ mac: '44:8a:5b:f1:3a:7d',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'UDP',
+ portNumber: 161,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: [
+ {
+ id: 0,
+ cryptoType: null,
+ serviceName: 'SNMP_V2',
+ discoveredDate: -62135596800000,
+ port: null,
+ target: false
+ }
+ ]
+ },
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 21,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.101',
+ mac: '44:8a:5b:f1:f1:f3',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: null
+ },
+ {
+ id: 0,
+ ip: '192.168.1.102',
+ mac: '44:8a:5b:f1:f2:d3',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: null
+ },
+ {
+ id: 0,
+ ip: '192.168.1.205',
+ mac: '40:98:ad:7b:d0:43',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: null
+ },
+ {
+ id: 0,
+ ip: '192.168.1.103',
+ mac: '44:8a:5b:44:8c:e8',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 21,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.10',
+ mac: 'd0:50:99:97:5d:99',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: [
+ {
+ id: 0,
+ portType: 'TCP',
+ portNumber: 22,
+ discoveredDate: -62135596800000,
+ host: null,
+ services: null
+ }
+ ]
+ },
+ {
+ id: 0,
+ ip: '192.168.1.203',
+ mac: 'a8:e5:39:5b:c9:62',
+ os: null,
+ discoveredDate: -62135596800000,
+ target: false,
+ zone: null,
+ ports: null
+ }
+ ];
-// }
diff --git a/src/packages/discovery/discovery.module.ts b/src/packages/discovery/discovery.module.ts
index 6172753..752e376 100644
--- a/src/packages/discovery/discovery.module.ts
+++ b/src/packages/discovery/discovery.module.ts
@@ -1,39 +1,37 @@
-// import { NgModule, Inject } from '@angular/core';
-// import { CommonModule } from '@angular/common';
-// import { FormsModule } from '@angular/forms';
+import { NgModule, Inject } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
-// import { MaterialModule } from 'packages/commons/material/material.module';
// import { InputChipModule } from 'packages/commons/component/input-chip/input-chip.module';
-// import { DiscoveryStoreModule } from './discovery-store.module';
-// import { DiscoveryRPCModule } from './discovery-rpc.module';
-// import { DiscoveryLoggerModule } from './discovery-logger.module';
+import { DiscoveryStoreModule } from './discovery-store.module';
+import { DiscoveryRPCModule } from './discovery-rpc.module';
+import { DiscoveryLoggerModule } from './discovery-logger.module';
-// import { COMPONENTS } from './component';
-// import { SERVICES } from './service';
-// import { TreeModule } from 'angular-tree-component';
+import { COMPONENTS } from './component';
+import { SERVICES } from './service';
+import { PrimeNGModules } from 'packages/commons/prime-ng/prime-ng.module';
-// @NgModule({
-// imports: [
-// CommonModule,
-// MaterialModule,
-// InputChipModule,
-// FormsModule,
-// TreeModule,
-// DiscoveryStoreModule,
-// DiscoveryRPCModule,
-// DiscoveryLoggerModule,
-// ],
-// declarations: [
-// COMPONENTS
-// ],
-// exports: [
-// COMPONENTS,
-// ],
-// providers: [
-// SERVICES,
-// ],
-// })
-// export class DiscoveryModule {
-// }
+@NgModule({
+ imports: [
+ CommonModule,
+ // InputChipModule,
+ FormsModule,
+ PrimeNGModules,
+ DiscoveryStoreModule,
+ DiscoveryRPCModule,
+ DiscoveryLoggerModule,
+ ],
+ declarations: [
+ COMPONENTS
+ ],
+ exports: [
+ COMPONENTS,
+ ],
+ providers: [
+ SERVICES,
+ ],
+})
+export class DiscoveryModule {
+}