fix: 修复访问最近报告中已删除的报告报错的问题
This commit is contained in:
parent
534957aa77
commit
b9d48bd00e
|
@ -62,6 +62,7 @@ export default {
|
|||
let url = "/api/report/get/" + this.reportId;
|
||||
this.$get(url, response => {
|
||||
this.report = response.data || {};
|
||||
if (response.data) {
|
||||
if (this.isNotRunning) {
|
||||
try {
|
||||
this.content = JSON.parse(this.report.content);
|
||||
|
@ -74,6 +75,10 @@ export default {
|
|||
} else {
|
||||
setTimeout(this.getReport, 2000)
|
||||
}
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.$error(this.$t('api_report.not_exist'));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -43,12 +43,12 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<el-divider/>
|
||||
|
||||
<el-tabs v-model="active" type="border-card" :stretch="true">
|
||||
<el-tab-pane :label="$t('report.test_overview')">
|
||||
<!-- <ms-report-test-overview :id="reportId" :status="status"/>-->
|
||||
<ms-report-test-overview :report="report"/>
|
||||
<ms-report-test-overview :report="report" ref="testOverview"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('report.test_request_statistics')">
|
||||
<ms-report-request-statistics :report="report"/>
|
||||
|
@ -63,8 +63,8 @@
|
|||
|
||||
</el-card>
|
||||
<el-dialog :title="$t('report.test_stop_now_confirm')" :visible.sync="dialogFormVisible" width="30%">
|
||||
<p v-html="$t('report.force_stop_tips')"></p>
|
||||
<p v-html="$t('report.stop_tips')"></p>
|
||||
<p v-html="$t('report.force_stop_tips')"/>
|
||||
<p v-html="$t('report.stop_tips')"/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="danger" size="small" @click="stopTest(true)">{{$t('report.force_stop_btn')}}
|
||||
</el-button>
|
||||
|
@ -190,7 +190,7 @@
|
|||
} else {
|
||||
this.report.status = 'Completed';
|
||||
}
|
||||
})
|
||||
});
|
||||
this.dialogFormVisible = false;
|
||||
},
|
||||
rerun(testId) {
|
||||
|
@ -201,7 +201,7 @@
|
|||
}).then(() => {
|
||||
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.$router.push({path: '/performance/report/view/' + this.reportId});
|
||||
// 注册 socket
|
||||
this.initWebSocket();
|
||||
})
|
||||
|
@ -235,6 +235,7 @@
|
|||
this.reportId = this.$route.path.split('/')[4];
|
||||
this.result = this.$get("/performance/report/" + this.reportId, res => {
|
||||
let data = res.data;
|
||||
if (data) {
|
||||
this.status = data.status;
|
||||
this.$set(this.report, "id", this.reportId);
|
||||
this.$set(this.report, "status", data.status);
|
||||
|
@ -242,9 +243,13 @@
|
|||
if (this.status === "Completed" || this.status === "Running") {
|
||||
this.initReportTimeInfo();
|
||||
}
|
||||
})
|
||||
this.initBreadcrumb();
|
||||
this.initWebSocket();
|
||||
} else {
|
||||
this.$error(this.$t('report.not_exist'))
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.websocket.close() //离开路由之后断开websocket连接
|
||||
|
@ -288,6 +293,8 @@
|
|||
} else {
|
||||
this.clearData();
|
||||
}
|
||||
} else {
|
||||
this.$error(this.$t('report.not_exist'));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -266,6 +266,7 @@ export default {
|
|||
stop_tips: 'A <strong>Graceful shutdown</strong> will archive the JTL files and then stop the servers.',
|
||||
force_stop_btn: 'Terminating',
|
||||
stop_btn: 'Graceful shutdown',
|
||||
not_exist: "Test report does not exist",
|
||||
},
|
||||
load_test: {
|
||||
operating: 'Operating',
|
||||
|
@ -476,6 +477,7 @@ export default {
|
|||
detail: "Report detail",
|
||||
delete: "Delete report",
|
||||
running: "The test is running",
|
||||
not_exist: "Test report does not exist",
|
||||
},
|
||||
test_track: {
|
||||
test_track: "Track",
|
||||
|
|
|
@ -264,6 +264,7 @@ export default {
|
|||
stop_tips: '<strong>停止</strong>测试会结束当前测试并保留报告数据',
|
||||
force_stop_btn: '强制停止',
|
||||
stop_btn: '停止',
|
||||
not_exist: "测试报告不存在",
|
||||
},
|
||||
load_test: {
|
||||
operating: '操作',
|
||||
|
@ -475,6 +476,7 @@ export default {
|
|||
detail: "报告详情",
|
||||
delete: "删除报告",
|
||||
running: "测试执行中",
|
||||
not_exist: "测试报告不存在",
|
||||
},
|
||||
test_track: {
|
||||
test_track: "测试跟踪",
|
||||
|
|
|
@ -264,6 +264,7 @@ export default {
|
|||
stop_tips: '<strong>停止</strong>測試會結束當前測試並保留報告數據',
|
||||
force_stop_btn: '強制停止',
|
||||
stop_btn: '停止',
|
||||
not_exist: "測試報告不存在",
|
||||
},
|
||||
load_test: {
|
||||
operating: '操作',
|
||||
|
@ -475,6 +476,7 @@ export default {
|
|||
detail: "報告詳情",
|
||||
delete: "刪除報告",
|
||||
running: "測試執行中",
|
||||
not_exist: "測試報告不存在",
|
||||
},
|
||||
test_track: {
|
||||
test_track: "測試跟踪",
|
||||
|
|
Loading…
Reference in New Issue