From 625a87062961f4eac87f89e51d5d1be609b35cdc Mon Sep 17 00:00:00 2001 From: q4speed Date: Tue, 22 Sep 2020 10:49:03 +0800 Subject: [PATCH 1/6] refactor(XPack): update submodule --- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index de612c8ef4..15425f3e00 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit de612c8ef47f93c8720ac918d22aaa172977b6f7 +Subproject commit 15425f3e0076c47ff2089b34e2c90ef18cf258dd diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 6ae17a7ced..fff34ae133 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 6ae17a7ced8f8175531f959ed0a0a6a707ba27dc +Subproject commit fff34ae13389a21bb89e3276f52c519e6eade247 From 3b2059de146bf8c2a5c3079e5ac31126a1dfffb5 Mon Sep 17 00:00:00 2001 From: q4speed Date: Tue, 22 Sep 2020 14:39:08 +0800 Subject: [PATCH 2/6] refactor(XPack): update submodule --- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 15425f3e00..ca1b956888 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 15425f3e0076c47ff2089b34e2c90ef18cf258dd +Subproject commit ca1b956888a85d9cb7c8b7b8b8692e658e4a63f8 diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index fff34ae133..6dfc8fe7d5 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit fff34ae13389a21bb89e3276f52c519e6eade247 +Subproject commit 6dfc8fe7d5d43dbc80b45942bdcc90999f5c0e99 From 3674320e9b3696c7f764bb68e08f0acd8504b361 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 22 Sep 2020 17:48:30 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BF=85=E5=A1=AB=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/request/database/DatabaseFrom.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/test/components/request/database/DatabaseFrom.vue b/frontend/src/business/components/api/test/components/request/database/DatabaseFrom.vue index 4fab4c7e19..89919ab28b 100644 --- a/frontend/src/business/components/api/test/components/request/database/DatabaseFrom.vue +++ b/frontend/src/business/components/api/test/components/request/database/DatabaseFrom.vue @@ -88,18 +88,24 @@ {max: 300, message: this.$t('commons.input_limit', [0, 300]), trigger: 'blur'} ], driver: [ - {required: true, message: this.$t('commons.input_name'), trigger: 'blur'}, + {required: true, message: this.$t('commons.cannot_be_null'), trigger: 'blur'}, ], password: [ {max: 200, message: this.$t('commons.input_limit', [0, 200]), trigger: 'blur'} ], dbUrl: [ - {required: true, message: this.$t('commons.input_name'), trigger: 'blur'}, + {required: true, message: this.$t('commons.cannot_be_null'), trigger: 'blur'}, {max: 500, message: this.$t('commons.input_limit', [0, 500]), trigger: 'blur'} ], username: [ - {required: true, message: this.$t('commons.input_name'), trigger: 'blur'}, + {required: true, message: this.$t('commons.cannot_be_null'), trigger: 'blur'}, {max: 200, message: this.$t('commons.input_limit', [0, 200]), trigger: 'blur'} + ], + poolMax: [ + {required: true, message: this.$t('commons.cannot_be_null'), trigger: 'blur'}, + ], + timeout: [ + {required: true, message: this.$t('commons.cannot_be_null'), trigger: 'blur'}, ] } } From 569b01f5896b21d0fb0f1474926449aa671a3d8f Mon Sep 17 00:00:00 2001 From: q4speed Date: Tue, 22 Sep 2020 21:29:53 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor(XPack):=20License=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=83=BD=E6=94=BE=E5=88=B0XPack=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/controller/LoginController.java | 6 ------ .../java/io/metersphere/service/LicenseService.java | 10 ---------- .../main/java/io/metersphere/service/UserService.java | 9 +-------- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 5 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 backend/src/main/java/io/metersphere/service/LicenseService.java diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index e0a2e015b1..015c0fa641 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -67,10 +67,4 @@ public class LoginController { public String getDefaultLanguage() { return userService.getDefaultLanguage(); } - - @GetMapping("/api/license/valid") - public LicenseDTO valid() { - return userService.validateLicense(); - } - } diff --git a/backend/src/main/java/io/metersphere/service/LicenseService.java b/backend/src/main/java/io/metersphere/service/LicenseService.java deleted file mode 100644 index 25e46b3d18..0000000000 --- a/backend/src/main/java/io/metersphere/service/LicenseService.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.metersphere.service; - -import io.metersphere.dto.LicenseDTO; - -public interface LicenseService { - - public LicenseDTO valid(); - - public LicenseDTO addValidLicense(String reqLicenseCode); -} diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index e72a0b56d0..d88864f060 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -36,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; + import java.util.*; import java.util.stream.Collectors; @@ -591,12 +592,4 @@ public class UserService { public List searchUser(String condition) { return extUserMapper.searchUser(condition); } - - public LicenseDTO validateLicense() { - LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class); - if (licenseService != null) { - return licenseService.valid(); - } - return null; - } } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index ca1b956888..e51e5704f9 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit ca1b956888a85d9cb7c8b7b8b8692e658e4a63f8 +Subproject commit e51e5704f9d7fbfb030a8a7d67d0094a9f36c23d diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 6dfc8fe7d5..2c5f7e1585 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 6dfc8fe7d5d43dbc80b45942bdcc90999f5c0e99 +Subproject commit 2c5f7e15858f51e836cffa911f8ab7511b3cc0d5 From b0faae20b530009a78cc98ee29bf244bd55e2095 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 22 Sep 2020 21:48:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/report/ApiReportExport.vue | 136 ++++++++++++++++++ .../api/report/ApiReportReqestHeaderItem.vue | 31 ++++ .../components/api/report/ApiReportView.vue | 60 ++++++-- .../report/PerformanceReportView.vue | 13 +- 4 files changed, 216 insertions(+), 24 deletions(-) create mode 100644 frontend/src/business/components/api/report/ApiReportExport.vue create mode 100644 frontend/src/business/components/api/report/ApiReportReqestHeaderItem.vue diff --git a/frontend/src/business/components/api/report/ApiReportExport.vue b/frontend/src/business/components/api/report/ApiReportExport.vue new file mode 100644 index 0000000000..5e1ace1bcd --- /dev/null +++ b/frontend/src/business/components/api/report/ApiReportExport.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/frontend/src/business/components/api/report/ApiReportReqestHeaderItem.vue b/frontend/src/business/components/api/report/ApiReportReqestHeaderItem.vue new file mode 100644 index 0000000000..a9d096095d --- /dev/null +++ b/frontend/src/business/components/api/report/ApiReportReqestHeaderItem.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/frontend/src/business/components/api/report/ApiReportView.vue b/frontend/src/business/components/api/report/ApiReportView.vue index 9827f371b9..bf1b5fe461 100644 --- a/frontend/src/business/components/api/report/ApiReportView.vue +++ b/frontend/src/business/components/api/report/ApiReportView.vue @@ -9,10 +9,10 @@ {{ report.projectName }} / {{ report.testName }} {{ report.createTime | timestampFormatDate }} - + @@ -36,6 +36,7 @@ + @@ -52,10 +53,14 @@ import MsMetricChart from "./components/MetricChart"; import MsScenarioResults from "./components/ScenarioResults"; import MsContainer from "@/business/components/common/components/MsContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer"; +import MsApiReportExport from "./ApiReportExport"; +import {exportPdf} from "../../../../common/js/utils"; +import html2canvas from "html2canvas"; export default { name: "MsApiReportView", components: { + MsApiReportExport, MsMainContainer, MsContainer, MsScenarioResults, MsRequestResultTail, MsMetricChart, MsScenarioResult, MsRequestResult }, @@ -70,6 +75,7 @@ export default { isRequestResult: false, request: {}, scenarioName: null, + reportExportVisible: false } }, activated() { @@ -139,6 +145,26 @@ export default { this.request = requestResult.request; this.scenarioName = requestResult.scenarioName; }); + }, + handleExport(name) { + this.loading = true; + this.reportExportVisible = true; + let reset = this.exportReportReset; + + this.$nextTick(function () { + setTimeout(() => { + html2canvas(document.getElementById('apiTestReport'), { + scale: 2 + }).then(function(canvas) { + exportPdf(name, [canvas]); + reset(); + }); + }, 1000); + }); + }, + exportReportReset() { + this.reportExportVisible = false; + this.loading = false; } }, @@ -170,30 +196,36 @@ export default { diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 4069038da9..0bbfaf8df5 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -66,28 +66,21 @@
- From 06f7531969e278f3f56bbc67df02f2e8d64f2d50 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 22 Sep 2020 21:54:23 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E6=8A=A5=E5=91=8A=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/common/js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/common/js/utils.js b/frontend/src/common/js/utils.js index 5c100179fd..07f9de5c01 100644 --- a/frontend/src/common/js/utils.js +++ b/frontend/src/common/js/utils.js @@ -255,7 +255,7 @@ export function exportPdf(name, canvasList) { } } - pdf.save(name); + pdf.save(name + '.pdf'); }