From a92db96844aeb23668e1c18b6ca5128e88d3409a Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 7 Sep 2020 13:42:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=8A=A0=E5=BC=BAhost=E5=88=97=E8=A1=A8=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/test/ApiTestConfig.vue | 534 +++++++++--------- .../api/test/components/ApiHostTable.vue | 3 + .../business/components/api/test/model/JMX.js | 4 +- .../api/test/model/ScenarioModel.js | 4 +- 4 files changed, 274 insertions(+), 271 deletions(-) diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index a7b46b108a..0eb893a484 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -65,300 +65,300 @@ diff --git a/frontend/src/business/components/api/test/components/ApiHostTable.vue b/frontend/src/business/components/api/test/components/ApiHostTable.vue index 5b804f5a0e..7601c9315e 100644 --- a/frontend/src/business/components/api/test/components/ApiHostTable.vue +++ b/frontend/src/business/components/api/test/components/ApiHostTable.vue @@ -123,6 +123,9 @@ validateDomain(domain) { let url = {}; try { + if (!domain.startsWith("http") || !domain.startsWith("https")) { + domain += "http://"; + } url = new URL(domain); } catch (e) { this.$warning(this.$t('load_test.input_domain')); diff --git a/frontend/src/business/components/api/test/model/JMX.js b/frontend/src/business/components/api/test/model/JMX.js index ea90014e2e..90cd6cc076 100644 --- a/frontend/src/business/components/api/test/model/JMX.js +++ b/frontend/src/business/components/api/test/model/JMX.js @@ -504,8 +504,8 @@ export class DNSCacheManager extends DefaultTestElement { let collectionPropHosts = this.collectionProp('DNSCacheManager.hosts'); hosts.forEach(host => { - let elementProp = collectionPropHosts.elementProp('', 'StaticHost'); - if (host && host.domain.trim() === domain.trim()) { + let elementProp = collectionPropHosts.elementProp(host.domain, 'StaticHost'); + if (host && host.domain.trim().indexOf(domain.trim()) != -1) { elementProp.stringProp('StaticHost.Name', host.domain); elementProp.stringProp('StaticHost.Address', host.ip); } diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index 511c3c8661..f84ca536de 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -948,8 +948,8 @@ class JMXGenerator { let name = request.name + " DNSCacheManager"; let hosts = JSON.parse(request.environment.hosts); if (hosts.length > 0) { - let domain = request.environment.protocol + "://" + request.environment.domain; - threadGroup.put(new DNSCacheManager(name, domain, hosts)); + //let domain = request.environment.protocol + "://" + request.environment.domain; + threadGroup.put(new DNSCacheManager(name, request.environment.domain, hosts)); } } }