Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wenyann 2020-06-02 15:35:03 +08:00
commit d0975fe528
7 changed files with 31 additions and 19 deletions

View File

@ -90,7 +90,7 @@
<el-col class="test-detail" :span="20" :offset="1"> <el-col class="test-detail" :span="20" :offset="1">
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange"> <el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')"> <el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
<api-test-detail v-if="testCase.type == 'api'" @runTest="testRun" :id="testCase.testId" ref="apiTestDetail"/> <api-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'api'" @runTest="testRun" :id="testCase.testId" ref="apiTestDetail"/>
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'performance'" @runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/> <performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'performance'" @runTest="testRun" :id="testCase.testId" ref="performanceTestDetail"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')"> <el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">

View File

@ -10,7 +10,7 @@
:placeholder="$t('api_test.select_project')"> :placeholder="$t('api_test.select_project')">
</el-select> </el-select>
</el-input> </el-input>
<el-button type="primary" plain @click="runTest"> <el-button :disabled="isReadOnly" type="primary" plain @click="runTest">
{{$t('api_test.run')}} {{$t('api_test.run')}}
</el-button> </el-button>
</el-row> </el-row>
@ -31,7 +31,13 @@
export default { export default {
name: "ApiTestDetail", name: "ApiTestDetail",
components: {MsMainContainer, MsContainer, MsApiScenarioConfig}, components: {MsMainContainer, MsContainer, MsApiScenarioConfig},
props: ["id"], props: {
id: String,
isReadOnly: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
result: {}, result: {},

View File

@ -1,7 +1,7 @@
<template> <template>
<ms-container> <ms-container>
<ms-main-container> <ms-main-container>
<span v-if="!reportId">尚未执行</span> <span v-if="!reportId">{{$t('commons.not_performed_yet')}}</span>
<el-card v-if="reportId"> <el-card v-if="reportId">
<section class="report-container" v-loading="loading"> <section class="report-container" v-loading="loading">
<header class="report-header"> <header class="report-header">

View File

@ -1,7 +1,8 @@
<template> <template>
<ms-container> <ms-container>
<ms-main-container> <ms-main-container>
<el-card v-loading="result.loading"> <span v-if="!reportId">{{$t('commons.not_performed_yet')}}</span>
<el-card v-loading="result.loading" v-if="reportId">
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
<el-row> <el-row>
@ -147,13 +148,13 @@
this.$warning(this.$t('report.generation_error')); this.$warning(this.$t('report.generation_error'));
break; break;
case 'Starting': case 'Starting':
this.$warning("测试处于开始状态,请稍后查看报告!"); this.$warning(this.$t('report.start_status'));
break; break;
case 'Reporting': case 'Reporting':
this.$info(this.$t('report.being_generated')); this.$info(this.$t('report.being_generated'));
break; break;
case 'Running': case 'Running':
this.$warning("测试处于运行状态,请稍后查看报告!"); this.$warning(this.$t('report.run_status'));
break; break;
case 'Completed': case 'Completed':
default: default:
@ -205,15 +206,17 @@
} }
}, },
getReport() { getReport() {
this.result = this.$get("/performance/report/" + this.reportId, res => { if (this.reportId) {
let data = res.data; this.result = this.$get("/performance/report/" + this.reportId, res => {
this.status = data.status; let data = res.data;
this.$set(this.report, "id", this.reportId); this.status = data.status;
this.$set(this.report, "status", data.status); this.$set(this.report, "id", this.reportId);
if (this.status === "Completed") { this.$set(this.report, "status", data.status);
this.initReportTimeInfo(); if (this.status === "Completed") {
} this.initReportTimeInfo();
}); }
});
}
this.initBreadcrumb(); this.initBreadcrumb();
} }
} }

View File

@ -92,7 +92,8 @@ export default {
'remove': 'Remove', 'remove': 'Remove',
'remove_cancel': 'Remove Cancel', 'remove_cancel': 'Remove Cancel',
'remove_success': 'Remove Success', 'remove_success': 'Remove Success',
'tips': 'The authentication information has expired, please login again' 'tips': 'The authentication information has expired, please login again',
'not_performed_yet': 'Not performed yet',
}, },
workspace: { workspace: {
'create': 'Create Workspace', 'create': 'Create Workspace',

View File

@ -91,7 +91,8 @@ export default {
'remove': '移除', 'remove': '移除',
'remove_cancel': '移除取消', 'remove_cancel': '移除取消',
'remove_success': '移除成功', 'remove_success': '移除成功',
'tips': '认证信息已过期,请重新登录' 'tips': '认证信息已过期,请重新登录',
'not_performed_yet': '尚未执行',
}, },
workspace: { workspace: {
'create': '创建工作空间', 'create': '创建工作空间',

View File

@ -91,7 +91,8 @@ export default {
'remove': '移除', 'remove': '移除',
'remove_cancel': '移除取消', 'remove_cancel': '移除取消',
'remove_success': '移除成功', 'remove_success': '移除成功',
'tips': '认認證資訊已過期,請重新登入' 'tips': '认認證資訊已過期,請重新登入',
'not_performed_yet': '尚未執行',
}, },
workspace: { workspace: {
'create': '創建工作空間', 'create': '創建工作空間',