再次执行测试功能

This commit is contained in:
Captain.B 2020-07-02 16:43:49 +08:00
parent 4730a63a13
commit 48c0299ca8
4 changed files with 19 additions and 2 deletions

View File

@ -18,10 +18,11 @@
@click="stopTest(reportId)"> @click="stopTest(reportId)">
{{$t('report.test_stop_now')}} {{$t('report.test_stop_now')}}
</el-button> </el-button>
<!--<el-button :disabled="isReadOnly || status !== 'Completed'" type="success" plain size="mini"> <el-button :disabled="isReadOnly || status !== 'Completed'" type="success" plain size="mini"
@click="rerun(testId)">
{{$t('report.test_execute_again')}} {{$t('report.test_execute_again')}}
</el-button> </el-button>
<el-button :disabled="isReadOnly" type="info" plain size="mini"> <!--<el-button :disabled="isReadOnly" type="info" plain size="mini">
{{$t('report.export')}} {{$t('report.export')}}
</el-button> </el-button>
<el-button :disabled="isReadOnly" type="warning" plain size="mini"> <el-button :disabled="isReadOnly" type="warning" plain size="mini">
@ -179,6 +180,19 @@
}).catch(() => { }).catch(() => {
}); });
}, },
rerun(testId) {
this.$confirm(this.$t('report.test_rerun_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, () => {
this.$success(this.$t('load_test.is_running'))
this.$router.push({path: '/performance/report/all'})
})
}).catch(() => {
});
},
onOpen() { onOpen() {
window.console.log("open WebSocket"); window.console.log("open WebSocket");
}, },

View File

@ -205,6 +205,7 @@ export default {
'test_end_time': 'Test End Time', 'test_end_time': 'Test End Time',
'test_stop_now': 'Test Stop Now', 'test_stop_now': 'Test Stop Now',
'test_stop_now_confirm': 'Are you sure you want to stop the current test immediately?', 'test_stop_now_confirm': 'Are you sure you want to stop the current test immediately?',
'test_rerun_confirm': 'Are you sure you want to rerun the current test immediately?',
'test_stop_success': 'Test stop successfully', 'test_stop_success': 'Test stop successfully',
'test_execute_again': 'Test Execute Again', 'test_execute_again': 'Test Execute Again',
'export': 'Export', 'export': 'Export',

View File

@ -203,6 +203,7 @@ export default {
'test_end_time': '结束时间', 'test_end_time': '结束时间',
'test_stop_now': '立即停止', 'test_stop_now': '立即停止',
'test_stop_now_confirm': '确定要立即停止当前测试吗?', 'test_stop_now_confirm': '确定要立即停止当前测试吗?',
'test_rerun_confirm': '确定要再次执行当前测试吗?',
'test_stop_success': '停止成功', 'test_stop_success': '停止成功',
'test_execute_again': '再次执行', 'test_execute_again': '再次执行',
'export': '导出', 'export': '导出',

View File

@ -203,6 +203,7 @@ export default {
'test_end_time': '結束時間', 'test_end_time': '結束時間',
'test_stop_now': '立即停止', 'test_stop_now': '立即停止',
'test_stop_now_confirm': '確定要立即停止當前測試嗎?', 'test_stop_now_confirm': '確定要立即停止當前測試嗎?',
'test_rerun_confirm': '確定要再次執行當前測試嗎?',
'test_stop_success': '停止成功', 'test_stop_success': '停止成功',
'test_execute_again': '再次執行', 'test_execute_again': '再次執行',
'export': '導出', 'export': '導出',