diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index 71a9dce003..14c7cadc18 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -33,6 +33,7 @@ import io.metersphere.job.sechedule.ApiTestJob; import io.metersphere.service.FileService; import io.metersphere.service.ScheduleService; import io.metersphere.track.service.TestCaseService; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.constants.CommonConstants; @@ -43,7 +44,6 @@ import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; @@ -505,14 +505,9 @@ public class APITestService { //HTTPSamplerProxy, 进行附件转化: 1.elementProp里去掉路径; 2。elementProp->filePath获取路径并读出来 attachmentFilePathList.addAll(this.parseAttachmentFileInfo(element)); - //查看是否含有RunningDebugSampler,转jmx的时候去掉 - List debugSamplerElementList = element.elements("DebugSampler"); - for (Element debugSampler : debugSamplerElementList) { - String testname = debugSampler.attributeValue("testname"); - if (StringUtils.equalsAnyIgnoreCase(testname, RunningParamKeys.RUNNING_DEBUG_SAMPLER_NAME)) { - element.remove(debugSampler); - } - } + //检查并去掉RunningDebugSampler,转jmx的时候去掉 + this.checkAndRemoveRunningDebugSampler(element); + } //如果存在证书文件,也要匹配出来 attachmentFilePathList.addAll(this.parseAttachmentFileInfo(innerHashTreeElement)); @@ -551,6 +546,23 @@ public class APITestService { return returnDTO; } + private void checkAndRemoveRunningDebugSampler(Element element) { + List childElements = element.elements(); + if (CollectionUtils.isNotEmpty(childElements)) { + if (childElements.size() > 1) { + Element checkElement = childElements.get(childElements.size() - 2); + String elementName = checkElement.attributeValue("testname"); + if (StringUtils.equalsIgnoreCase(elementName, RunningParamKeys.RUNNING_DEBUG_SAMPLER_NAME)) { + Element checkHashTreeElement = childElements.get(childElements.size() - 1); + if (StringUtils.equalsIgnoreCase("hashtree", checkHashTreeElement.getName())) { + element.remove(checkHashTreeElement); + element.remove(checkElement); + } + } + } + } + } + private List parseAttachmentFileInfo(Element parentHashTreeElement) { List attachmentFilePathList = new ArrayList<>(); List parentElementList = parentHashTreeElement.elements(); diff --git a/frontend/src/business/components/reportstatistics/projectstatistics/ReportCard.vue b/frontend/src/business/components/reportstatistics/projectstatistics/ReportCard.vue index 405e0bfb26..c758fd6bff 100644 --- a/frontend/src/business/components/reportstatistics/projectstatistics/ReportCard.vue +++ b/frontend/src/business/components/reportstatistics/projectstatistics/ReportCard.vue @@ -27,7 +27,7 @@
- 预留模块敬请期待 + {{ $t('commons.report_statistics.reserved') }}
@@ -38,7 +38,7 @@
- 预留模块敬请期待 + {{ $t('commons.report_statistics.reserved') }}
@@ -49,7 +49,7 @@
- 预留模块敬请期待 + {{ $t('commons.report_statistics.reserved') }}
@@ -60,7 +60,7 @@
- 预留模块敬请期待 + {{ $t('commons.report_statistics.reserved') }}
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index d21c71ff0d..c279e76a2b 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -314,6 +314,7 @@ export default { default_module: "Default module", }, report_statistics: { + reserved: "Reserved", menu: { project_statistics: "Project statistics", project_report: "Project report", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 156390b32c..5993d04ee3 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -315,6 +315,7 @@ export default { default_module: "默认模块", }, report_statistics: { + reserved: "预留模块敬请期待", menu: { project_statistics: "项目报表", project_report: "项目报告", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index d72e8a7462..64c53a9f45 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -315,6 +315,7 @@ export default { default_module: "默認模塊", }, report_statistics: { + reserved: "預留模塊敬請期待", menu: { project_statistics: "項目報表", project_report: "項目報告",