diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 86f8e9d10d..b17edd0afc 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -133,6 +133,7 @@ import MsPerformanceReportExport from "./PerformanceReportExport"; import {Message} from "element-ui"; import SameTestReports from "@/business/components/performance/report/components/SameTestReports"; import MonitorCard from "@/business/components/performance/report/components/MonitorCard"; +import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent"; export default { @@ -264,6 +265,8 @@ export default { this.result = this.$get('/performance/stop/' + this.reportId + '/' + forceStop, () => { this.$success(this.$t('report.test_stop_success')); if (forceStop) { + // 发送广播,刷新 head 上的最新列表 + PerformanceEvent.$emit(LIST_CHANGE); this.$router.push('/performance/report/all'); this.websocket.close(); } else { @@ -281,6 +284,7 @@ export default { this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => { this.reportId = response.data; this.$router.push({path: '/performance/report/view/' + this.reportId}); + this.clearData(); }); }).catch(() => { }); diff --git a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue index 57db4e43f3..9fa6f39551 100644 --- a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue @@ -31,11 +31,11 @@ + :disabled="true" + :placeholder="$t('load_test.input_thread_num')" + v-model="threadGroup.threadNumber" + :min="1" + size="mini"/>
@@ -98,10 +98,10 @@
+ :disabled="true" + :min="1" + v-model="threadGroup.rampUpTime" + size="mini"/>
@@ -171,11 +171,11 @@ const DELETED = "deleted"; const hexToRgba = function (hex, opacity) { return 'rgba(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5)) + ',' - + parseInt('0x' + hex.slice(5, 7)) + ',' + opacity + ')'; + + parseInt('0x' + hex.slice(5, 7)) + ',' + opacity + ')'; }; const hexToRgb = function (hex) { return 'rgb(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5)) - + ',' + parseInt('0x' + hex.slice(5, 7)) + ')'; + + ',' + parseInt('0x' + hex.slice(5, 7)) + ')'; }; export default { @@ -288,30 +288,34 @@ export default { return; } let threadGroups = []; - this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id, (response) => { - let d = response.data; - threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name)); - threadGroups.forEach(tg => { - tg.options = {}; - }); - this.threadGroups = threadGroups; - this.getLoadConfig(); - - // 兼容数据 - if (!threadGroups || threadGroups.length === 0) { - this.result = this.$get('/performance/get-jmx-content/' + this.report.testId, (response) => { - response.data.forEach(d => { - threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name)); - threadGroups.forEach(tg => { - tg.options = {}; - }); - this.threadGroups = threadGroups; - this.getLoadConfig(); - }); + this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id) + .then((response) => { + let d = response.data.data; + threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name)); + threadGroups.forEach(tg => { + tg.options = {}; }); - } + this.threadGroups = threadGroups; + this.getLoadConfig(); - }); + // 兼容数据 + if (!threadGroups || threadGroups.length === 0) { + this.result = this.$get('/performance/get-jmx-content/' + this.report.testId) + .then((response) => { + response.data.data.forEach(d => { + threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name)); + threadGroups.forEach(tg => { + tg.options = {}; + }); + this.threadGroups = threadGroups; + this.getLoadConfig(); + }); + }) + .catch(() => { + }); + } + }).catch(() => { + }); }, calculateTotalChart() { let handler = this;