This commit is contained in:
insanity 2018-09-10 16:45:54 +09:00
parent 21d685443a
commit c170301c42
3 changed files with 78 additions and 5 deletions

72
package-lock.json generated
View File

@ -6144,6 +6144,45 @@
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=",
"dev": true "dev": true
}, },
"ip-address": {
"version": "5.8.9",
"resolved": "https://nexus.loafle.net/repository/npm-all/ip-address/-/ip-address-5.8.9.tgz",
"integrity": "sha512-7ay355oMN34iXhET1BmCJVsHjOTSItEEIIpOs38qUC23AIhOy+xIPnkrTuEFjeLMrTJ7m8KMXWgWfy/2Vn9sDw==",
"dev": true,
"requires": {
"jsbn": "1.1.0",
"lodash.find": "4.6.0",
"lodash.max": "4.0.1",
"lodash.merge": "4.6.1",
"lodash.padstart": "4.6.1",
"lodash.repeat": "4.1.0",
"sprintf-js": "1.1.0"
},
"dependencies": {
"jsbn": {
"version": "1.1.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha1-sBMHyym2GKHtJux56RH4A8TaAEA=",
"dev": true
},
"sprintf-js": {
"version": "1.1.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/sprintf-js/-/sprintf-js-1.1.0.tgz",
"integrity": "sha1-z/yvcC2vZeo5u04PorKZzsGhvkY=",
"dev": true
}
}
},
"ip-cidr": {
"version": "2.0.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/ip-cidr/-/ip-cidr-2.0.0.tgz",
"integrity": "sha512-RG2+JvxGxdrZ4vJkn0pk2wpOhywTNxxvcLW2/1wqFTMpuk2fzTagZbU33ztlgF0pwRkSmSMo0kaNCCSazJr7Rw==",
"dev": true,
"requires": {
"ip-address": "5.8.9",
"jsbn": "0.1.1"
}
},
"ipaddr.js": { "ipaddr.js": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/ipaddr.js/-/ipaddr.js-1.8.0.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
@ -6817,8 +6856,7 @@
"jsbn": { "jsbn": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/jsbn/-/jsbn-0.1.1.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
"optional": true
}, },
"jsesc": { "jsesc": {
"version": "1.3.0", "version": "1.3.0",
@ -7364,6 +7402,24 @@
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
"dev": true "dev": true
}, },
"lodash.find": {
"version": "4.6.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.find/-/lodash.find-4.6.0.tgz",
"integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=",
"dev": true
},
"lodash.max": {
"version": "4.0.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.max/-/lodash.max-4.0.1.tgz",
"integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=",
"dev": true
},
"lodash.merge": {
"version": "4.6.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.merge/-/lodash.merge-4.6.1.tgz",
"integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==",
"dev": true
},
"lodash.mergewith": { "lodash.mergewith": {
"version": "4.6.1", "version": "4.6.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
@ -7371,6 +7427,18 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"lodash.padstart": {
"version": "4.6.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.padstart/-/lodash.padstart-4.6.1.tgz",
"integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=",
"dev": true
},
"lodash.repeat": {
"version": "4.1.0",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.repeat/-/lodash.repeat-4.1.0.tgz",
"integrity": "sha1-/H3oEx2MisB+S0n3T/6CnR8r7EQ=",
"dev": true
},
"lodash.tail": { "lodash.tail": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://nexus.loafle.net/repository/npm-all/lodash.tail/-/lodash.tail-4.1.1.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/lodash.tail/-/lodash.tail-4.1.1.tgz",

View File

@ -83,6 +83,7 @@
"wait-on": "^2.1.0", "wait-on": "^2.1.0",
"webpack-cli": "^3.1.0", "webpack-cli": "^3.1.0",
"webpack-node-externals": "^1.7.2", "webpack-node-externals": "^1.7.2",
"zone.js": "^0.8.26" "zone.js": "^0.8.26",
"ip-cidr": "^2.0.0"
} }
} }

View File

@ -4,6 +4,9 @@ import { DiscoverHost, Zone } from '@overflow/model/discovery';
import { toMetaIPType, MetaIPTypeEnum, MetaPortTypeEnum } from '@overflow/model/meta'; import { toMetaIPType, MetaIPTypeEnum, MetaPortTypeEnum } from '@overflow/model/meta';
import { DiscoveryConfigService } from '../service/discovery-config.service'; import { DiscoveryConfigService } from '../service/discovery-config.service';
const IPCIDR = require("ip-cidr");
@Component({ @Component({
selector: 'app-scanner-setting-dropdown', selector: 'app-scanner-setting-dropdown',
templateUrl: './scanner-setting-dropdown.component.html', templateUrl: './scanner-setting-dropdown.component.html',
@ -48,10 +51,11 @@ export class ScannerSettingDropdownComponent implements OnInit {
return; return;
} }
const cidr = new IPCIDR(zone.network);
this.ipType = MetaIPTypeEnum.V4; this.ipType = MetaIPTypeEnum.V4;
this.firstIP = zone.address; this.firstIP = cidr.start();
this.lastIP = '192.168.1.254' this.lastIP = cidr.end();
this.includePortType = [MetaPortTypeEnum.TCP, MetaPortTypeEnum.UDP] this.includePortType = [MetaPortTypeEnum.TCP, MetaPortTypeEnum.UDP]
this.firstPort = '1' this.firstPort = '1'
this.lastPort = '65535' this.lastPort = '65535'