From 23779785c9a42c5c8b4a4222f9b4af683f542863 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 24 Nov 2022 11:37:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8F=90=E7=A4=BA=E8=A2=AB=E9=81=AE?= =?UTF-8?q?=E6=8C=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ApiJMeterFileService.java | 30 ++++++++----------- .../metersphere/dto/JmeterRunRequestDTO.java | 5 ---- .../plan/components/ScheduleMaintain.vue | 4 +++ 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java index 579875d951..25f2632fbb 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java @@ -194,29 +194,25 @@ public class ApiJMeterFileService { } else { return new HashMap<>(); } - } private Map getPlugJar() { Map jarFiles = new LinkedHashMap<>(); - // jar 包 List plugins = pluginService.list(); if (CollectionUtils.isNotEmpty(plugins)) { - plugins = plugins.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() - -> new TreeSet<>(Comparator.comparing(Plugin::getPluginId))), ArrayList::new)); - if (CollectionUtils.isNotEmpty(plugins)) { - plugins.forEach(item -> { - String path = item.getSourcePath(); - File file = new File(path); - if (file.isDirectory() && !path.endsWith("/")) { - file = new File(path + "/"); - } - byte[] fileByte = FileUtils.fileToByte(file); - if (fileByte != null) { - jarFiles.put(file.getName(), fileByte); - } - }); - } + plugins = plugins.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> + new TreeSet<>(Comparator.comparing(Plugin::getPluginId))), ArrayList::new)); + plugins.forEach(item -> { + File file = new File(item.getSourcePath()); + if (file.isDirectory() && !item.getSourcePath().endsWith("/")) { + file = new File(item.getSourcePath() + "/"); + } + byte[] fileByte = FileUtils.fileToByte(file); + if (fileByte != null) { + jarFiles.put(file.getName(), fileByte); + } + }); + } return jarFiles; } diff --git a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/JmeterRunRequestDTO.java b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/JmeterRunRequestDTO.java index 06a3d84ae2..c819172dc3 100644 --- a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/JmeterRunRequestDTO.java +++ b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/JmeterRunRequestDTO.java @@ -59,11 +59,6 @@ public class JmeterRunRequestDTO { */ private HashTree hashTree; - /** - * Node 执行脚本 - */ - private String jmxScript; - /** * 并发数 */ diff --git a/test-track/frontend/src/business/plan/components/ScheduleMaintain.vue b/test-track/frontend/src/business/plan/components/ScheduleMaintain.vue index 36d632a600..544ce642ea 100644 --- a/test-track/frontend/src/business/plan/components/ScheduleMaintain.vue +++ b/test-track/frontend/src/business/plan/components/ScheduleMaintain.vue @@ -425,6 +425,10 @@ export default { }); }, saveCron() { + if (this.runConfig.runWithinResourcePool && this.runConfig.resourcePoolId == null) { + this.$warning(this.$t('workspace.env_group.please_select_run_within_resource_pool')); + return; + } this.$refs['from'].validate((valid) => { if (valid) { this.intervalShortValidate();