diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java index 4131860918..4f52f09396 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java @@ -82,7 +82,9 @@ public class MsTCPSampler extends MsTestElement { samplerHashTree.add(tcpConfig()); tree.set(tcpSampler(config), samplerHashTree); setUserParameters(samplerHashTree); - samplerHashTree.add(tcpPreProcessor.getJSR223PreProcessor()); + if (tcpPreProcessor != null) { + samplerHashTree.add(tcpPreProcessor.getJSR223PreProcessor()); + } if (CollectionUtils.isNotEmpty(hashTree)) { hashTree.forEach(el -> { el.toHashTree(samplerHashTree, el.getHashTree(), config); diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index 2b765169fe..489d58abfb 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -356,6 +356,8 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl return protocol.toUpperCase(); } return RequestType.DUBBO; + } else if (StringUtils.contains(result.getResponseHeaders(), "url:jdbc")) { + return "SQL"; } else { // Http Method String method = StringUtils.substringBefore(body, " "); diff --git a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java index abcfa543c8..c59a8664e1 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java @@ -95,7 +95,7 @@ public class DockerTestEngine extends AbstractEngine { env.put("BOOTSTRAP_SERVERS", kafkaProperties.getBootstrapServers()); env.put("LOG_TOPIC", kafkaProperties.getLog().getTopic()); env.put("RESOURCE_ID", resource.getId()); - env.put("THREAD_NUM", "" + threadNum); + env.put("THREAD_NUM", "0");// 传入0表示不用修改线程数 env.put("HEAP", jmeterProperties.getHeap()); diff --git a/backend/src/main/java/io/metersphere/performance/service/JmeterFileService.java b/backend/src/main/java/io/metersphere/performance/service/JmeterFileService.java index 65f0396d00..3a5782eb5b 100644 --- a/backend/src/main/java/io/metersphere/performance/service/JmeterFileService.java +++ b/backend/src/main/java/io/metersphere/performance/service/JmeterFileService.java @@ -50,6 +50,10 @@ public class JmeterFileService { } private void setThreadNum(LoadTestWithBLOBs t, Integer limit) { + // 传入limit才去改这个值 + if (limit <= 0) { + return; + } String loadConfiguration = t.getLoadConfiguration(); JSONArray jsonArray = JSON.parseArray(loadConfiguration); for (int i = 0; i < jsonArray.size(); i++) { diff --git a/backend/src/main/java/io/metersphere/service/NodeResourcePoolService.java b/backend/src/main/java/io/metersphere/service/NodeResourcePoolService.java index fc16e3c70c..2531d644c7 100644 --- a/backend/src/main/java/io/metersphere/service/NodeResourcePoolService.java +++ b/backend/src/main/java/io/metersphere/service/NodeResourcePoolService.java @@ -12,6 +12,7 @@ import io.metersphere.dto.TestResourcePoolDTO; import io.metersphere.i18n.Translator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -39,29 +40,16 @@ public class NodeResourcePoolService { } deleteTestResource(testResourcePool.getId()); - List nodeIps = testResourcePool.getResources().stream() + List Ip_Port = testResourcePool.getResources().stream() .map(resource -> { NodeDTO nodeDTO = JSON.parseObject(resource.getConfiguration(), NodeDTO.class); - return nodeDTO.getIp(); + return new ImmutablePair(nodeDTO.getIp(), nodeDTO.getPort()); }) .distinct() .collect(Collectors.toList()); - List nodePorts = testResourcePool.getResources().stream() - .map(resource -> { - NodeDTO nodeDTO = JSON.parseObject(resource.getConfiguration(), NodeDTO.class); - return nodeDTO.getPort(); - }) - .distinct() - .collect(Collectors.toList()); - if (nodeIps.size() < testResourcePool.getResources().size() && nodePorts.size() < testResourcePool.getResources().size()) { + if (Ip_Port.size() < testResourcePool.getResources().size()) { MSException.throwException(Translator.get("duplicate_node_ip_port")); } - else if (nodeIps.size() < testResourcePool.getResources().size()) { - MSException.throwException(Translator.get("duplicate_node_ip")); - } - else if (nodePorts.size() < testResourcePool.getResources().size()) { - MSException.throwException(Translator.get("duplicate_node_port")); - } testResourcePool.setStatus(VALID.name()); boolean isValid = true; for (TestResource resource : testResourcePool.getResources()) { diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index c1f1f6e0ef..5b99d9a620 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -50,7 +50,7 @@ public class TestPlanController { QueryTestPlanRequest request = new QueryTestPlanRequest(); request.setWorkspaceId(workspaceId); request.setProjectId(projectId); - return testPlanService.listTestPlan(request); + return testPlanService.listTestPlanByProject(request); } @PostMapping("/list/all") diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index ed891ee750..792ace0c68 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit ed891ee7503cc1ca4679b4779a5c12e2ffee986d +Subproject commit 792ace0c68d2b4ff42a74d8e6df32ca7f290ca1c diff --git a/frontend/src/business/components/api/automation/report/components/ResponseText.vue b/frontend/src/business/components/api/automation/report/components/ResponseText.vue index d732c953c5..1122eb1afa 100644 --- a/frontend/src/business/components/api/automation/report/components/ResponseText.vue +++ b/frontend/src/business/components/api/automation/report/components/ResponseText.vue @@ -45,8 +45,8 @@ @@ -110,7 +110,7 @@ computed: { isSqlType() { - return (this.requestType === RequestFactory.TYPES.SQL && this.response.responseCode === '200'); + return ((this.requestType === RequestFactory.TYPES.SQL || this.request.method === RequestFactory.TYPES.SQL) && this.response.responseCode === '200'&& this.mode === 'table'); } } } diff --git a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue index f5897a3516..4b757583b1 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -40,8 +40,10 @@
- - +
+ + +
diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index fbe24ef940..433d9ef3f8 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -190,6 +190,7 @@ } this.request.requestResult = requestResult; this.request.id = response.data.id; + this.request.disabled = true; this.reload(); this.sort(); } else { @@ -200,6 +201,7 @@ }, recursiveSorting(arr) { for (let i in arr) { + arr[i].disabled = true; arr[i].index = Number(i) + 1; if (arr[i].hashTree != undefined && arr[i].hashTree.length > 0) { this.recursiveSorting(arr[i].hashTree); @@ -208,6 +210,7 @@ }, sort() { for (let i in this.request.hashTree) { + this.request.hashTree[i].disabled = true; this.request.hashTree[i].index = Number(i) + 1; if (this.request.hashTree[i].hashTree != undefined && this.request.hashTree[i].hashTree.length > 0) { this.recursiveSorting(this.request.hashTree[i].hashTree); diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue index c98ca9d676..8604026beb 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue @@ -6,6 +6,7 @@ :data="scenario" :show-collapse="false" :is-show-name-input="!isDeletedOrRef" + :is-disabled="true" color="#606266" background-color="#F4F4F5" :title="$t('api_test.automation.scenario_import')"> @@ -45,6 +46,10 @@ if (response.data.scenarioDefinition) { this.scenario.hashTree = JSON.parse(response.data.scenarioDefinition).hashTree; } + if (this.scenario.hashTree) { + this.setDisabled(this.scenario.hashTree); + } + this.scenario.disabled = true; this.scenario.name = response.data.name; this.$emit('refReload'); } else { @@ -85,6 +90,22 @@ this.loading = false }) }, + recursive(arr) { + for (let i in arr) { + arr[i].disabled = true; + if (arr[i].hashTree != undefined && arr[i].hashTree.length > 0) { + this.recursive(arr[i].hashTree); + } + } + }, + setDisabled(scenarioDefinition) { + for (let i in scenarioDefinition) { + scenarioDefinition[i].disabled = true; + if (scenarioDefinition[i].hashTree != undefined && scenarioDefinition[i].hashTree.length > 0) { + this.recursive(scenarioDefinition[i].hashTree); + } + } + }, } } diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 56a5fda42e..c592ab32b1 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -222,7 +222,6 @@ } if (this.$refs.apiConfig) { this.$refs.apiConfig.forEach(item => { - console.log(item); item.removeListener(); }); // 删除所有tab的 ctrl + s 监听 let tabs = this.apiTabs; diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 4223cf1c3a..6edfb4b64e 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -95,7 +95,7 @@

{{$t('api_test.definition.request.res_param')}}

- + diff --git a/frontend/src/business/components/api/definition/components/import/ApiImport.vue b/frontend/src/business/components/api/definition/components/import/ApiImport.vue index c15783b710..a808a985f2 100644 --- a/frontend/src/business/components/api/definition/components/import/ApiImport.vue +++ b/frontend/src/business/components/api/definition/components/import/ApiImport.vue @@ -20,19 +20,13 @@ - - - - - + - + @@ -43,7 +37,16 @@ :active-text="$t('api_test.api_import.swagger_url_import')"> - + + + + + + + + + + - - - { //解决localStorage清空,cookie没失效导致的卡死问题 if (!localStorage.getItem('Admin-Token')) { - axios.get("/signout"); - console.log("signout"); + // axios.get("/signout"); + // console.log("signout"); localStorage.setItem('Admin-Token', "{}"); window.location.href = "/login"; next(); diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue index dfae67b1c5..b50dbfa2b3 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue @@ -104,7 +104,8 @@ search() { this.selectRows = new Set(); this.loading = true; - this.condition.filters = ["Prepare", "Underway", "Completed"]; + + this.condition.filters = {status: ["Prepare", "Underway", "Completed"]}; this.condition.moduleIds = this.selectNodeIds; diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 6d6ed52268..416645a24d 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 6d6ed5226849337876ecf55312aa6b5f13ba6472 +Subproject commit 416645a24d941eb9727c07c19be70422c2e66cc7