This commit is contained in:
Captain.B 2020-02-27 17:23:06 +08:00
parent 4fb03996c2
commit a24d15f6ae
5 changed files with 71 additions and 31 deletions

View File

@ -21,6 +21,9 @@ const en_US = {
'password': 'Password', 'password': 'Password',
'input_username': 'Please enter username', 'input_username': 'Please enter username',
'input_password': 'Please enter password', 'input_password': 'Please enter password',
'test': 'Test',
'create_time': 'Created Time',
'update_time': 'Updated Time',
}, },
workspace: { workspace: {
'create': 'Create Workspace', 'create': 'Create Workspace',
@ -47,6 +50,22 @@ const en_US = {
'search_by_name': 'Search by name', 'search_by_name': 'Search by name',
'input_name': 'Please enter a workspace name', 'input_name': 'Please enter a workspace name',
}, },
load_test: {
'recent': 'Recent Tests',
'search_by_name': 'Search by name',
'project_name': 'Project',
'delete_confirm': 'Are you sure want to delete test: ',
'input_name': 'Please enter name',
'select_project': 'Please select project',
'save_and_run': 'Save and execute',
'basic_config': 'Scene Configuration',
'pressure_config': 'Pressure configuration',
'advanced_config': 'Advanced Configuration',
'is_running': 'Test is running! ',
'test_name_is_null': 'Test name cannot be empty! ',
'project_is_null': 'Project cannot be empty! ',
'jmx_is_null': 'JMX file cannot be empty! ',
},
i18n: { i18n: {
'home': 'Home', 'home': 'Home',
} }

View File

@ -21,6 +21,9 @@ const zh_CN = {
'password': '密码', 'password': '密码',
'input_username': '请输入用户名', 'input_username': '请输入用户名',
'input_password': '请输入密码', 'input_password': '请输入密码',
'test': '测试',
'create_time': '创建时间',
'update_time': '更新时间',
}, },
workspace: { workspace: {
'create': '创建工作空间', 'create': '创建工作空间',
@ -47,6 +50,22 @@ const zh_CN = {
'search_by_name': '根据名称搜索', 'search_by_name': '根据名称搜索',
'input_name': '请输入项目名称', 'input_name': '请输入项目名称',
}, },
load_test: {
'recent': '最近的测试',
'search_by_name': '根据名称搜索',
'project_name': '所属项目',
'delete_confirm': '确认删除测试: ',
'input_name': '请输入名称',
'select_project': '请选择项目',
'save_and_run': '保存并执行',
'basic_config': '场景配置',
'pressure_config': '压力配置',
'advanced_config': '高级配置',
'is_running': '正在运行!',
'test_name_is_null': '测试名称不能为空!',
'project_is_null': '项目不能为空!',
'jmx_is_null': 'JMX文件不能为空',
},
i18n: { i18n: {
'home': '首页', 'home': '首页',
} }

View File

@ -4,9 +4,11 @@
<el-card> <el-card>
<div slot="header"> <div slot="header">
<el-row type="flex" justify="space-between" align="middle"> <el-row type="flex" justify="space-between" align="middle">
<span class="title">测试</span> <span class="title">{{$t('commons.test')}}</span>
<span class="search"> <span class="search">
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search" maxlength="60" <el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/> v-model="condition" @change="search" clearable/>
</span> </span>
</el-row> </el-row>
@ -18,41 +20,41 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="名称" :label="$t('commons.name')"
width="150" width="150"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="description" prop="description"
label="描述" :label="$t('commons.description')"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="projectName" prop="projectName"
label="所属项目" :label="$t('load_test.project_name')"
width="150" width="150"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
width="250" width="250"
label="创建时间"> :label="$t('commons.create_time')">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span> <span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
width="250" width="250"
label="更新时间"> :label="$t('commons.update_time')">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span> <span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
width="150" width="150"
label="操作"> :label="$t('commons.operating')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button> <el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="text" size="small">删除</el-button> <el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -145,8 +147,8 @@
}) })
}, },
handleDelete(testPlan) { handleDelete(testPlan) {
this.$alert('确认删除测试: ' + testPlan.name + "", '', { this.$alert(this.$t('load_test.delete_confirm') + testPlan.name + "", '', {
confirmButtonText: '确定', confirmButtonText: this.$t('commons.confirm'),
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
this._handleDelete(testPlan); this._handleDelete(testPlan);
@ -161,7 +163,7 @@
this.result = this.$post(this.deletePath, data, () => { this.result = this.$post(this.deletePath, data, () => {
this.$message({ this.$message({
message: '删除成功!', message: this.$t('commons.delete_success'),
type: 'success' type: 'success'
}); });
this.initTableData(); this.initTableData();

View File

@ -4,8 +4,8 @@
<el-card> <el-card>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-input placeholder="请输入名称" v-model="testPlan.name" class="input-with-select"> <el-input :placeholder="$t('load_test.input_name')" v-model="testPlan.name" class="input-with-select">
<el-select v-model="testPlan.projectId" slot="prepend" placeholder="请选择项目"> <el-select v-model="testPlan.projectId" slot="prepend" :placeholder="$t('load_test.select_project')">
<el-option <el-option
v-for="item in projects" v-for="item in projects"
:key="item.id" :key="item.id"
@ -15,20 +15,20 @@
</el-select> </el-select>
</el-input> </el-input>
</el-col> </el-col>
<el-button type="primary" plain @click="save">保存</el-button> <el-button type="primary" plain @click="save">{{$t('commons.save')}}</el-button>
<el-button type="primary" plain @click="saveAndRun">保存并执行</el-button> <el-button type="primary" plain @click="saveAndRun">{{$t('load_test.save_and_run')}}</el-button>
<el-button type="warning" plain @click="cancel">取消</el-button> <el-button type="warning" plain @click="cancel">{{$t('commons.cancel')}}</el-button>
</el-row> </el-row>
<el-tabs class="testplan-config" v-model="active" type="border-card" :stretch="true"> <el-tabs class="testplan-config" v-model="active" type="border-card" :stretch="true">
<el-tab-pane label="基础配置"> <el-tab-pane :label="$t('load_test.basic_config')">
<ms-test-plan-basic-config :test-plan="testPlan"/> <ms-test-plan-basic-config :test-plan="testPlan"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="压力配置"> <el-tab-pane :label="$t('load_test.pressure_config')">
<ms-test-plan-pressure-config :test-plan="testPlan"/> <ms-test-plan-pressure-config :test-plan="testPlan"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="高级配置"> <el-tab-pane :label="$t('load_test.advanced_config')">
<ms-test-plan-advanced-config/> <ms-test-plan-advanced-config/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -61,15 +61,15 @@
projects: [], projects: [],
active: '0', active: '0',
tabs: [{ tabs: [{
title: '场景配置', title: this.$t('load_test.basic_config'),
id: '0', id: '0',
component: 'BasicConfig' component: 'BasicConfig'
}, { }, {
title: '压力配置', title: this.$t('load_test.pressure_config'),
id: '1', id: '1',
component: 'PressureConfig' component: 'PressureConfig'
}, { }, {
title: '高级配置', title: this.$t('load_test.advanced_config'),
id: '2', id: '2',
component: 'AdvancedConfig' component: 'AdvancedConfig'
}] }]
@ -115,7 +115,7 @@
this.result = this.$request(options, () => { this.result = this.$request(options, () => {
this.$message({ this.$message({
message: '保存成功!', message: this.$t('commons.save_success'),
type: 'success' type: 'success'
}); });
}); });
@ -130,13 +130,13 @@
this.result = this.$request(options, (response) => { this.result = this.$request(options, (response) => {
this.testPlan.id = response.data; this.testPlan.id = response.data;
this.$message({ this.$message({
message: '保存成功!', message: this.$t('commons.save_success'),
type: 'success' type: 'success'
}); });
this.result = this.$post(this.runPath, {id: this.testPlan.id}).then(() => { this.result = this.$post(this.runPath, {id: this.testPlan.id}).then(() => {
this.$message({ this.$message({
message: '正在运行!', message: this.$t('load_test.is_running'),
type: 'success' type: 'success'
}); });
}) })
@ -176,7 +176,7 @@
validTestPlan() { validTestPlan() {
if (!this.testPlan.name) { if (!this.testPlan.name) {
this.$message({ this.$message({
message: '测试名称不能为空!', message: this.$t('load_test.test_name_is_null'),
type: 'error' type: 'error'
}); });
@ -185,7 +185,7 @@
if (!this.testPlan.projectId) { if (!this.testPlan.projectId) {
this.$message({ this.$message({
message: '项目不能为空!', message: this.$t('load_test.project_is_null'),
type: 'error' type: 'error'
}); });
@ -194,7 +194,7 @@
if (!this.testPlan.file) { if (!this.testPlan.file) {
this.$message({ this.$message({
message: 'jmx文件不能为空', message: this.$t('load_test.jmx_is_null'),
type: 'error' type: 'error'
}); });

View File

@ -2,7 +2,7 @@
<el-menu router menu-trigger="click" :default-active="$route.path"> <el-menu router menu-trigger="click" :default-active="$route.path">
<div class="recent-text"> <div class="recent-text">
<i class="el-icon-time"/> <i class="el-icon-time"/>
最近的测试 {{$t('load_test.recent')}}
</div> </div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/editTest/' + t.id"> <el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/editTest/' + t.id">
{{ t.name }} {{ t.name }}