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 5031c4e8893721d0ee2d949c996011b79abbee1a..219d3425e1954c66ef8ee5b84f9aa88e82633fca 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 d453cf6d1d3379158a1396195c32b427123b7854..9f4dc8e4ec4933766373f05d26358b1d92f404e3 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 9e1f872bb75366f05f3ab25896c903ab06ff44b8..77e894460649b897d9c4490fe8a788541fbfb315 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 c9c0cadcfd41f970156228adf237bb2cb7a691f8..ae2ea54d1966f3d893a4b77c9d2a74be0af749a5 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 fa85fbd54c5f3d734f9df0cf2e2ca406d83b21db..a74a80b0eb16983a82765b594ea594e8e20ed24f 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 9e91fcb7023324f7ac51b18387fa279022cae402..982412213a6e32f51ae4ae9ddeb203d6a21e711e 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: '開始執行時間',