diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java index 5031c4e889..219d3425e1 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java @@ -111,6 +111,11 @@ public class PerformanceReportController { return reportService.getLoadTestReport(reportId); } + @GetMapping("/pool/type/{reportId}") + public String getPoolTypeByReportId(@PathVariable String reportId) { + return reportService.getPoolTypeByReportId(reportId); + } + @GetMapping("log/resource/{reportId}") public List getResourceIds(@PathVariable String reportId) { return reportService.getReportLogResource(reportId); diff --git a/backend/src/main/java/io/metersphere/performance/service/ReportService.java b/backend/src/main/java/io/metersphere/performance/service/ReportService.java index d453cf6d1d..9f4dc8e4ec 100644 --- a/backend/src/main/java/io/metersphere/performance/service/ReportService.java +++ b/backend/src/main/java/io/metersphere/performance/service/ReportService.java @@ -59,6 +59,8 @@ public class ReportService { private FileService fileService; @Resource private SqlSessionFactory sqlSessionFactory; + @Resource + private TestResourcePoolMapper testResourcePoolMapper; public List getRecentReportList(ReportRequest request) { List orders = new ArrayList<>(); @@ -315,4 +317,18 @@ public class ReportService { } } } + + public String getPoolTypeByReportId(String reportId) { + LoadTestReportWithBLOBs report = getReport(reportId); + String testId = report.getTestId(); + LoadTestWithBLOBs test = loadTestMapper.selectByPrimaryKey(testId); + if (test != null) { + String poolId = test.getTestResourcePoolId(); + TestResourcePool testResourcePool = testResourcePoolMapper.selectByPrimaryKey(poolId); + if (testResourcePool != null) { + return testResourcePool.getType(); + } + } + return ""; + } } diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 9e1f872bb7..77e8944606 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -81,7 +81,7 @@ - + @@ -169,7 +169,8 @@ export default { {value: '30', label: '30s'}, {value: '60', label: '1m'}, {value: '300', label: '5m'} - ] + ], + poolType: "" }; }, methods: { @@ -379,6 +380,14 @@ export default { } } localStorage.setItem("reportRefreshTime", this.refreshTime); + }, + getPoolType(reportId) { + this.$get("/performance/report/pool/type/" + reportId, result => { + let data = result.data; + if (data) { + this.poolType = data; + } + }) } }, created() { @@ -388,6 +397,7 @@ export default { } this.reportId = this.$route.path.split('/')[4]; this.getReport(this.reportId); + this.getPoolType(this.reportId); }, watch: { '$route'(to) { diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index c9c0cadcfd..ae2ea54d19 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -441,6 +441,7 @@ export default { test_request_statistics: 'Test Request Statistics', test_error_log: 'Test Error Log', test_log_details: 'Test Log Details', + test_monitor_details: 'Test Monitor Details', test_details: 'Test Details', test_duration: 'Current Execution Time:{0} minutes {1} seconds', test_start_time: 'Start Execution Time', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index fa85fbd54c..a74a80b0eb 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -448,6 +448,7 @@ export default { test_request_statistics: '请求统计', test_error_log: '错误记录', test_log_details: '日志详情', + test_monitor_details: '监控详情', test_details: '测试详情', test_duration: '当前执行时长:{0} 分钟 {1} 秒', test_start_time: '开始执行时间', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 9e91fcb702..982412213a 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -439,6 +439,7 @@ export default { test_request_statistics: '請求統計', test_error_log: '錯誤記錄', test_log_details: '日誌詳情', + test_monitor_details: '監控詳情', test_details: '測試詳情', test_duration: '當前執行時長:{0} 分鐘 {1} 秒', test_start_time: '開始執行時間',