From 88705142df0fc01db22c131c9fdebe468a48a220 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 21 Sep 2018 11:10:39 +0900 Subject: [PATCH] test --- .../component/host-detail.component.html | 8 ++-- .../component/host-detail.component.ts | 1 + .../scanner-setting-dropdown.component.ts | 14 +++++-- .../component/service-detail.component.html | 13 +++--- .../component/zone-detail.component.html | 40 ++++++++++++++----- 5 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/commons/component/host-detail.component.html b/src/commons/component/host-detail.component.html index c22edf4..c4e7221 100644 --- a/src/commons/component/host-detail.component.html +++ b/src/commons/component/host-detail.component.html @@ -82,21 +82,21 @@
Count
- +
Interval
- +
Deadline
- +
- +
diff --git a/src/commons/component/host-detail.component.ts b/src/commons/component/host-detail.component.ts index 5b4b719..83eccaa 100644 --- a/src/commons/component/host-detail.component.ts +++ b/src/commons/component/host-detail.component.ts @@ -56,6 +56,7 @@ export class HostDetailComponent implements OnChanges { console.log(pingResult); if (pingResult) { this.pingResult = pingResult; + console.log(pingResult.raw); this.pingResultRaw = pingResult.raw.join(''); } this.pingWaiting = false; diff --git a/src/commons/component/scanner-setting-dropdown.component.ts b/src/commons/component/scanner-setting-dropdown.component.ts index 7a8cb85..c64c423 100644 --- a/src/commons/component/scanner-setting-dropdown.component.ts +++ b/src/commons/component/scanner-setting-dropdown.component.ts @@ -33,6 +33,8 @@ export class ScannerSettingDropdownComponent implements OnInit { zone: Zone; lastCondition: Condition = null; + validIPArray: string[]; + constructor( private discoveryConfigService: DiscoveryConfigService ) { @@ -50,13 +52,13 @@ export class ScannerSettingDropdownComponent implements OnInit { if (this.zone === null) { return; } - console.log(this.zone); - const cidr = new IPCIDR(this.zone.network); + const cidrUtil = new IPCIDR(this.zone.network); + this.validIPArray = cidrUtil.toArray(); this.ipType = MetaIPTypeEnum.V4; - this.firstIP = cidr.start(); - this.lastIP = cidr.end(); + this.firstIP = cidrUtil.start(); + this.lastIP = cidrUtil.end(); this.includePortType = [MetaPortTypeEnum.TCP, MetaPortTypeEnum.UDP]; this.firstPort = '1'; this.lastPort = '65535'; @@ -74,6 +76,10 @@ export class ScannerSettingDropdownComponent implements OnInit { this.ipErrMsg = 'Invalid IP format.'; return; } + if (this.validIPArray.indexOf(value) === -1) { + this.ipErrMsg = 'Invalid IP range.'; + return; + } const from = idx === 0 ? value : this.firstIP; const to = idx === 1 ? value : this.lastIP; if (this.ipToNum(from) > this.ipToNum(to)) { diff --git a/src/commons/component/service-detail.component.html b/src/commons/component/service-detail.component.html index 665fc11..40a1f64 100644 --- a/src/commons/component/service-detail.component.html +++ b/src/commons/component/service-detail.component.html @@ -65,21 +65,22 @@
Count
- +
Interval
- +
Deadline
- +
- - + + No. @@ -88,7 +89,7 @@ - + {{i + 1}} diff --git a/src/commons/component/zone-detail.component.html b/src/commons/component/zone-detail.component.html index e310422..e762e30 100644 --- a/src/commons/component/zone-detail.component.html +++ b/src/commons/component/zone-detail.component.html @@ -44,16 +44,36 @@ - - - +