From 36497b14555e0f996407f9aea51c2fb5e8e4da0b Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 29 Mar 2018 21:08:29 +0900 Subject: [PATCH] bug fix --- .../component/setting/setting.component.ts | 47 ++++++++++++------- .../list/filter/filter.component.html | 4 +- .../target-selector.component.html | 2 +- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/packages/discovery/component/setting/setting.component.ts b/src/packages/discovery/component/setting/setting.component.ts index 3c6a3aa..1b07e01 100644 --- a/src/packages/discovery/component/setting/setting.component.ts +++ b/src/packages/discovery/component/setting/setting.component.ts @@ -5,7 +5,9 @@ import { RPCClientError } from '@loafer/ng-rpc/protocol'; import { DiscoveryStartInfo, DiscoveryZone, - Zone + Zone, + DiscoveryPort, + DiscoveryService } from '../../model'; import * as CIDR from 'ip-cidr'; import * as DiscoveredStore from '../../store/setting'; @@ -185,7 +187,9 @@ export class SettingComponent implements OnInit, AfterContentInit { } handleServiceCheckChange(e: MatCheckboxChange) { - this.includeServices = null; + if (e.checked) { + this.portChecked = true; + } } handleServiceChange(list: any) { @@ -193,31 +197,38 @@ export class SettingComponent implements OnInit, AfterContentInit { } discovery() { - if (!this.portChecked) { - this.startPort = '0'; - this.endPort = '0'; + 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, + }; } - const services = new Array(); - for (const service of this.includeServices) { - services.push(service.name); + 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: { - firstScanRange: this.startPort, - lastScanRange: this.endPort, - includeTCP: this.tcpChecked, - includeUDP: this.udpChecked, - excludePorts: null, - discoveryService: { - includeServices: services - } - }, + discoveryPort: discoveryPort, }, }; + console.log(discoveryZone); + console.log('start discovery - ' + this.probe.probeKey); this.discoverstore.dispatch(new DiscoverStore.DiscoverZone( { probeID: this.probe.probeKey, discoveryZone: discoveryZone })); diff --git a/src/packages/sensor/component/list/filter/filter.component.html b/src/packages/sensor/component/list/filter/filter.component.html index b71faba..d0fbdc8 100644 --- a/src/packages/sensor/component/list/filter/filter.component.html +++ b/src/packages/sensor/component/list/filter/filter.component.html @@ -15,7 +15,7 @@
Status
- All + All Active Inactive @@ -23,7 +23,7 @@
Type
- All + All Host Application diff --git a/src/packages/sensor/component/setting/target-selector/target-selector.component.html b/src/packages/sensor/component/setting/target-selector/target-selector.component.html index 2905d56..21e11ad 100644 --- a/src/packages/sensor/component/setting/target-selector/target-selector.component.html +++ b/src/packages/sensor/component/setting/target-selector/target-selector.component.html @@ -9,7 +9,7 @@ - + {{t.displayName}}