This commit is contained in:
chenjianxing 2020-07-07 09:13:32 +08:00
parent 76b68b2214
commit 3341602733
25 changed files with 326 additions and 119 deletions

View File

@ -3,6 +3,8 @@ package io.metersphere.api.service;
import io.metersphere.base.domain.ApiTestEnvironmentExample;
import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs;
import io.metersphere.base.mapper.ApiTestEnvironmentMapper;
import io.metersphere.commons.exception.MSException;
import io.metersphere.i18n.Translator;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -37,7 +39,20 @@ public class ApiTestEnvironmentService {
public String add(ApiTestEnvironmentWithBLOBs apiTestEnvironmentWithBLOBs) {
apiTestEnvironmentWithBLOBs.setId(UUID.randomUUID().toString());
checkEnvironmentExist(apiTestEnvironmentWithBLOBs);
apiTestEnvironmentMapper.insert(apiTestEnvironmentWithBLOBs);
return apiTestEnvironmentWithBLOBs.getId();
}
private void checkEnvironmentExist (ApiTestEnvironmentWithBLOBs environment) {
if (environment.getName() != null) {
ApiTestEnvironmentExample example = new ApiTestEnvironmentExample();
example.createCriteria()
.andNameEqualTo(environment.getName())
.andProjectIdEqualTo(environment.getProjectId());
if (apiTestEnvironmentMapper.selectByExample(example).size() > 0) {
MSException.throwException(Translator.get("api_test_environment_already_exists"));
}
}
}
}

View File

@ -66,6 +66,7 @@ organization_id_is_null=Organization ID cannot be null
#api
api_load_script_error=Load script error
api_report_is_null="Report is null, can't update"
api_test_environment_already_exists="Api test environment already exists"
#test case
test_case_node_level=level
test_case_node_level_tip=The node tree maximum depth is

View File

@ -66,6 +66,7 @@ organization_id_is_null=组织 ID 不能为空
#api
api_load_script_error=读取脚本失败
api_report_is_null="测试报告是未生成,无法更新"
api_test_environment_already_exists="已存在该名称的环境配置"
#test case
test_case_node_level=
test_case_node_level_tip=模块树最大深度为

View File

@ -66,6 +66,7 @@ organization_id_is_null=組織 ID 不能為空
#api
api_load_script_error=讀取腳本失敗
api_report_is_null="測試報告是未生成,無法更新"
api_test_environment_already_exists="已存在該名稱的環境配置"
#test case
test_case_node_level=
test_case_node_level_tip=模塊樹最大深度為

View File

@ -228,13 +228,13 @@
url = '/api/schedule/update';
}
this.$post(url, param, response => {
this.$success('保存成功');
this.$success(this.$t('commons.save_success'));
this.getTest(this.test.id);
});
},
checkScheduleEdit() {
if (this.create) {
this.$message('请先保存测试');
this.$message(this.$t('api_test.environment.please_save_test'));
return false;
}
return true;

View File

@ -1,7 +1,7 @@
<template>
<el-dialog :title="'环境配置'" :visible.sync="visible" class="environment-dialog" @close="close">
<el-dialog :title="$t('api_test.environment.environment_config')" :visible.sync="visible" class="environment-dialog" @close="close">
<el-container v-loading="result.loading">
<ms-aside-item :title="'环境列表'" :data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment"
<ms-aside-item :title="$t('api_test.environment.environment_list')" :data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment"
:delete-fuc="deleteEnvironment" @itemSelected="environmentSelected" ref="environmentItems"/>
<environment-edit :environment="currentEnvironment" ref="environmentEdit"/>
</el-container>
@ -51,7 +51,7 @@
},
deleteEnvironment(environment) {
this.result = this.$get('/api/environment/delete/' + environment.id, response => {
this.$success('删除成功');
this.$success(this.$t('commons.delete_success'));
this.getEnvironments();
});
},

View File

@ -14,27 +14,27 @@
</el-input>
</el-form-item>
<el-form-item v-if="request.useEnvironment" :label="'请求路径'" prop="path">
<el-form-item v-if="request.useEnvironment" :label="$t('api_test.request.path')" prop="path">
<el-input :disabled="isReadOnly" v-model="request.path" maxlength="500"
:placeholder="'例如:/login'" @change="pathChange" clearable>
:placeholder="$t('api_test.request.path_description')" @change="pathChange" clearable>
<template v-slot:prepend>
<ApiRequestMethodSelect :is-read-only="isReadOnly" :request="request" @change="methodChange"/>
</template>
</el-input>
</el-form-item>
<el-form-item v-if="request.useEnvironment" :label="'请求地址'" class="adjust-margin-bottom">
<el-form-item v-if="request.useEnvironment" :label="$t('api_test.request.address')" class="adjust-margin-bottom">
<el-tag class="environment-display">
<span class="environment-name">{{request.environment ? request.environment.name + ': ' : ''}}</span>
<span class="environment-url">{{displayUrl}}</span>
<span v-if="!displayUrl" class="environment-url-tip">请在场景中配置环境</span>
<span v-if="!displayUrl" class="environment-url-tip">{{$t('api_test.request.please_configure_environment_in_scenario')}}</span>
</el-tag>
</el-form-item>
<el-form-item>
<el-switch
v-model="request.useEnvironment"
active-text="引用环境" @change="useEnvironmentChange">
:active-text="$t('api_test.request.refer_to_environment')" @change="useEnvironmentChange">
</el-switch>
</el-form-item>
@ -140,7 +140,7 @@
},
useEnvironmentChange(value) {
if (value && !this.request.environment) {
this.$error('请先在场景中添加环境配置!' , 2000);
this.$error(this.$t('api_test.request.please_add_environment_to_scenario'), 2000);
this.request.useEnvironment = false;
}
},

View File

@ -4,10 +4,10 @@
<el-input :disabled="isReadOnly" v-model="scenario.name" maxlength="100" show-word-limit/>
</el-form-item>
<el-form-item :label="'环境'">
<el-form-item :label="$t('api_test.environment.environment')">
<el-select :disabled="isReadOnly" v-model="scenario.environmentId" class="environment-select" @change="environmentChange" clearable>
<el-option v-for="(environment, index) in environments" :key="index" :label="environment.name + ': ' + environment.protocol + '://' + environment.socket" :value="environment.id"/>
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">环境配置</el-button>
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">{{$t('api_test.environment.environment_config')}}</el-button>
</el-select>
</el-form-item>

View File

@ -2,13 +2,13 @@
<el-main v-loading="result.loading">
<el-form :model="environment" :rules="rules" ref="from">
<span>环境名称</span>
<span>{{$t('api_test.environment.name')}}</span>
<el-form-item
prop="name">
<el-input v-model="environment.name" :placeholder="'请填写名称'" clearable></el-input>
<el-input v-model="environment.name" :placeholder="this.$t('commons.input_name')" clearable></el-input>
</el-form-item>
<span>环境域名</span>
<span>{{$t('api_test.environment.socket')}}</span>
<el-form-item
prop="socket">
<el-input v-model="environment.socket" :placeholder="$t('api_test.request.url_description')" clearable>
@ -21,14 +21,14 @@
</el-input>
</el-form-item>
<span>全局变量</span>
<span>{{$t('api_test.environment.globalVariable')}}</span>
<ms-api-scenario-variables :items="environment.variables"/>
<span>请求头</span>
<span>{{$t('api_test.request.headers')}}</span>
<ms-api-key-value :items="environment.headers"/>
<div class="environment-footer">
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="save">{{this.$t('commons.save')}}</el-button>
</div>
</el-form>
@ -53,7 +53,7 @@
data() {
let socketValidator = (rule, value, callback) => {
if (!this.validateSocket(value)) {
callback(new Error('格式错误'));
callback(new Error(this.$t('commons.formatErr')));
} else {
callback();
}
@ -61,7 +61,7 @@
return {
result: {},
rules: {
name :[{required: true, message: '请填写名称', trigger: 'blur'}],
name :[{required: true, message: this.$t('commons.input_name'), trigger: 'blur'}],
socket :[{required: true, validator: socketValidator, trigger: 'blur'}],
},
}
@ -84,7 +84,7 @@
}
this.result = this.$post(url, param, response => {
this.environment.id = response.data;
this.$success("保存成功");
this.$success(this.$t('commons.save_success'));
});
},
buildParam() {

View File

@ -10,7 +10,7 @@
<crontab-result v-show="false" :ex="schedule.value" ref="crontabResult" @resultListChange="resultListChange"/>
</div>
<div>
<span :class="{'disable-character': !schedule.enable}"> 下次执行时间{{this.recentList.length > 0 ? this.recentList[0] : '未设置'}} </span>
<span :class="{'disable-character': !schedule.enable}"> {{$t('schedule.next_execution_time')}}{{this.recentList.length > 0 ? this.recentList[0] : $t('schedule.not_set')}} </span>
</div>
</div>
</template>

View File

@ -1,17 +1,17 @@
<template>
<el-dialog width="30%" class="schedule-edit" :title="'编辑定时任务'" :visible.sync="dialogVisible" @close="close">
<el-dialog width="30%" class="schedule-edit" :title="$t('schedule.edit_timer_task')" :visible.sync="dialogVisible" @close="close">
<div id="app">
<el-form :model="form" :rules="rules" ref="from">
<el-form-item
:placeholder="'请输入 Cron 表达式'"
:placeholder="$t('schedule.please_input_cron_expression')"
prop="cronValue">
<el-input v-model="form.cronValue" placeholder class="inp"/>
<el-button type="primary" @click="showCronDialog">生成 Cron</el-button>
<el-button type="primary" @click="saveCron">保存</el-button>
<el-button type="primary" @click="showCronDialog">{{$t('schedule.generate_expression')}}</el-button>
<el-button type="primary" @click="saveCron">{{$t('commons.save')}}</el-button>
</el-form-item>
<crontab-result :ex="form.cronValue" ref="crontabResult" />
</el-form>
<el-dialog title="生成 cron" :visible.sync="showCron" :modal="false">
<el-dialog :title="$t('schedule.generate_expression')" :visible.sync="showCron" :modal="false">
<crontab @hide="showCron=false" @fill="crontabFill" :expression="schedule.value" ref="crontab"/>
</el-dialog>
</div>
@ -46,9 +46,9 @@
const validateCron = (rule, cronValue, callback) => {
let customValidate = this.customValidate(this.getIntervalTime());
if (!cronValidate(cronValue)) {
callback(new Error('Cron 表达式格式错误'));
callback(new Error(this.$t('schedule.cron_expression_format_error')));
} else if(!this.intervalShortValidate()) {
callback(new Error('间隔时间请大于 5 分钟'));
callback(new Error(this.$t('schedule.cron_expression_interval_short_error')));
} else if (!customValidate.pass){
callback(new Error(customValidate.info));
} else {

View File

@ -1,7 +1,7 @@
<template>
<div>
<el-tabs type="border-card">
<el-tab-pane label="秒" v-if="shouldHide('second')">
<el-tab-pane :label="$t('schedule.cron.seconds')" v-if="shouldHide('second')">
<crontab-second
@update="updateContabValue"
:check="checkNumber"
@ -9,7 +9,7 @@
/>
</el-tab-pane>
<el-tab-pane label="分钟" v-if="shouldHide('min')">
<el-tab-pane :label="$t('schedule.cron.minutes')" v-if="shouldHide('min')">
<crontab-min
@update="updateContabValue"
:check="checkNumber"
@ -18,7 +18,7 @@
/>
</el-tab-pane>
<el-tab-pane label="小时" v-if="shouldHide('hour')">
<el-tab-pane :label="$t('schedule.cron.hours')" v-if="shouldHide('hour')">
<crontab-hour
@update="updateContabValue"
:check="checkNumber"
@ -27,7 +27,7 @@
/>
</el-tab-pane>
<el-tab-pane label="日" v-if="shouldHide('day')">
<el-tab-pane :label="$t('schedule.cron.day')" v-if="shouldHide('day')">
<crontab-day
@update="updateContabValue"
:check="checkNumber"
@ -36,7 +36,7 @@
/>
</el-tab-pane>
<el-tab-pane label="月" v-if="shouldHide('mouth')">
<el-tab-pane :label="$t('schedule.cron.month')" v-if="shouldHide('mouth')">
<crontab-mouth
@update="updateContabValue"
:check="checkNumber"
@ -45,7 +45,7 @@
/>
</el-tab-pane>
<el-tab-pane label="周" v-if="shouldHide('week')">
<el-tab-pane :label="$t('schedule.cron.weeks')" v-if="shouldHide('week')">
<crontab-week
@update="updateContabValue"
:check="checkNumber"
@ -54,7 +54,7 @@
/>
</el-tab-pane>
<el-tab-pane label="年" v-if="shouldHide('year')">
<el-tab-pane :label="$t('schedule.cron.years')" v-if="shouldHide('year')">
<crontab-year @update="updateContabValue"
:check="checkNumber"
:cron="contabValueObj"
@ -64,11 +64,11 @@
<div class="popup-main">
<div class="popup-result-container">
<p class="title">时间表达式</p>
<p class="title">{{$t('schedule.cron.time_expression')}}</p>
<table>
<thead>
<th v-for="item of tabTitles" width="40" :key="item">{{item}}</th>
<th>crontab完整表达式</th>
<th>{{$t('schedule.cron.complete_expression')}}</th>
</thead>
<tbody>
<td>
@ -101,9 +101,9 @@
<crontab-result :ex="contabValueString" ref="crontabResult"/>
<div class="pop_btn">
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
<el-button size="small" type="warning" @click="clearCron">重置</el-button>
<el-button size="small" @click="hidePopup">取消</el-button>
<el-button size="small" type="primary" @click="submitFill">{{$t('commons.confirm')}}</el-button>
<el-button size="small" type="warning" @click="clearCron">{{$t('api_test.reset')}}</el-button>
<el-button size="small" @click="hidePopup">{{$t('commons.cancel')}}</el-button>
</div>
</div>
</div>
@ -123,7 +123,14 @@
name: "Crontab",
data() {
return {
tabTitles: ["秒", "分钟", "小时", "日", "月", "周", "年"],
tabTitles: [
this.$t('schedule.cron.seconds'),
this.$t('schedule.cron.minutes'),
this.$t('schedule.cron.hours'),
this.$t('schedule.cron.day'),
this.$t('schedule.cron.month'),
this.$t('schedule.cron.weeks'),
this.$t('schedule.cron.years')],
tabActive: 0,
myindex: 0,
contabValueObj: {
@ -179,7 +186,7 @@
"updateContabValue", name, value, from;
this.contabValueObj[name] = value;
if (from && from !== name) {
console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
// console.log(` ${from} ${name} ${value}`);
this.changeRadio(name, value);
}
},
@ -310,7 +317,7 @@
},
clearCron() {
//
("准备还原");
// ("");
this.contabValueObj = {
second: "*",
min: "*",

View File

@ -2,49 +2,49 @@
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * / L M]
{{$t('schedule.cron.day')}}{{$t('schedule.cron.day_allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
不指定
{{$t('schedule.cron.not_specify')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
周期从
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min="0" :max="31" /> -
<el-input-number v-model='cycle02' :min="0" :max="31" />
<el-input-number v-model='cycle02' :min="0" :max="31" /> {{$t('schedule.cron.day')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
<el-input-number v-model='average01' :min="0" :max="31" /> 号开始
<el-input-number v-model='average02' :min="0" :max="31" /> 日执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min="0" :max="31" /> {{$t('schedule.cron.day_unit')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min="0" :max="31" /> {{$t('schedule.cron.day')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="5">
每月
<el-input-number v-model='workday' :min="0" :max="31" /> 号最近的那个工作日
{{$t('schedule.cron.every')}}{{$t('schedule.cron.month')}}
<el-input-number v-model='workday' :min="0" :max="31" /> {{$t('schedule.cron.day_unit')}}{{$t('schedule.cron.last_working_day')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="6">
本月最后一天
{{$t('schedule.cron.last_working_day')}}{{$t('schedule.cron.last_day_of_the_month')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="7">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="item in 31" :key="item" :value="item">{{item}}</el-option>
</el-select>
</el-radio>

View File

@ -2,13 +2,13 @@
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
小时允许的通配符[, - * /]
</el-radio>
{{$t('schedule.cron.hours')}}{{$t('schedule.cron.allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min="0" :max="60" /> -
<el-input-number v-model='cycle02' :min="0" :max="60" /> 小时
</el-radio>
@ -16,16 +16,16 @@
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="0" :max="60" /> 小时开始
<el-input-number v-model='average02' :min="0" :max="60" /> 小时执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min="0" :max="60" /> {{$t('schedule.cron.hours')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min="0" :max="60" /> {{$t('schedule.cron.hours')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
</el-select>
</el-radio>

View File

@ -2,30 +2,30 @@
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
分钟允许的通配符[, - * /]
</el-radio>
{{$t('schedule.cron.minutes')}}{{$t('schedule.cron.allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min="0" :max="60" /> -
<el-input-number v-model='cycle02' :min="0" :max="60" /> 分钟
<el-input-number v-model='cycle02' :min="0" :max="60" /> {{$t('schedule.cron.minutes')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="0" :max="60" /> 分钟开始
<el-input-number v-model='average02' :min="0" :max="60" /> 分钟执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min="0" :max="60" /> {{$t('schedule.cron.minutes')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min="0" :max="60" /> {{$t('schedule.cron.minutes')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
</el-select>
</el-radio>

View File

@ -2,30 +2,30 @@
<el-form size='small'>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * /]
{{$t('schedule.cron.month')}}{{$t('schedule.cron.allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min="1" :max="12" /> -
<el-input-number v-model='cycle02' :min="1" :max="12" />
<el-input-number v-model='cycle02' :min="1" :max="12" /> {{$t('schedule.cron.month')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="1" :max="12" /> 月开始
<el-input-number v-model='average02' :min="1" :max="12" /> 月月执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min="1" :max="12" /> {{$t('schedule.cron.month')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min="1" :max="12" /> {{$t('schedule.cron.month')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
</el-select>
</el-radio>

View File

@ -1,6 +1,6 @@
<template>
<div class="popup-result">
<p class="title">最近5次运行时间</p>
<p class="title">{{$t('schedule.cron.recent_run_time')}}</p>
<ul class="popup-result-scroll">
<template>
<li v-for='item in resultList' :key="item">{{item}}</li>
@ -340,12 +340,12 @@ export default {
}
// 100
if (resultArr.length == 0) {
this.resultList = ['没有达到条件的结果!'];
this.resultList = [this.$t('schedule.cron.no_qualifying_results')];
} else {
this.resultList = resultArr;
if (resultArr.length !== 5) {
this.resultList.push('最近100年内只有上面' + resultArr.length + '条结果!')
}
// if (resultArr.length !== 5) {
// this.resultList.push('100' + resultArr.length + '')
// }
}
this.$emit("resultListChange", this.resultList);

View File

@ -2,30 +2,30 @@
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * /]
{{$t('schedule.cron.seconds')}}{{$t('schedule.cron.allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min="0" :max="60" /> -
<el-input-number v-model='cycle02' :min="0" :max="60" />
<el-input-number v-model='cycle02' :min="0" :max="60" /> {{$t('schedule.cron.seconds')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="0" :max="60" /> 秒开始
<el-input-number v-model='average02' :min="0" :max="60" /> 秒执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min="0" :max="60" /> {{$t('schedule.cron.seconds')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min="0" :max="60" /> {{$t('schedule.cron.seconds')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
</el-select>
</el-radio>

View File

@ -2,19 +2,19 @@
<el-form size='small'>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * / L #]
{{$t('schedule.cron.weeks')}}{{$t('schedule.cron.weeks_allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
不指定
{{$t('schedule.cron.not_specify')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
周期从星期
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}{{$t('schedule.cron.week')}}
<el-input-number v-model='cycle01' :min="1" :max="7" /> -
<el-input-number v-model='cycle02' :min="1" :max="7" />
</el-radio>
@ -22,23 +22,23 @@
<el-form-item>
<el-radio v-model='radioValue' :label="4">
<el-input-number v-model='average01' :min="1" :max="4" /> 周的星期
{{$t('schedule.cron.num')}}
<el-input-number v-model='average01' :min="1" :max="4" /> {{$t('schedule.cron.week_of_weeks')}}
<el-input-number v-model='average02' :min="1" :max="7" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="5">
本月最后一个星期
{{$t('schedule.cron.last_week_of_the_month')}}
<el-input-number v-model='weekday' :min="1" :max="7" />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="6">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
{{$t('schedule.cron.specify')}}
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple style="width:100%">
<el-option v-for="(item,index) of weekList" :key="index" :value="index+1">{{item}}</el-option>
</el-select>
</el-radio>
@ -58,7 +58,15 @@ export default {
average01: 1,
average02: 1,
checkboxList: [],
weekList: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
weekList: [
this.$t('commons.weeks_1'),
this.$t('commons.weeks_2'),
this.$t('commons.weeks_3'),
this.$t('commons.weeks_4'),
this.$t('commons.weeks_5'),
this.$t('commons.weeks_6'),
this.$t('commons.weeks_0'),
],
checkNum: this.$options.propsData.check
}
},

View File

@ -2,29 +2,29 @@
<el-form size="small">
<el-form-item>
<el-radio :label="1" v-model='radioValue'>
不填允许的通配符[, - * /]
</el-radio>
{{$t('schedule.cron.not_fill')}}{{$t('schedule.cron.allowed_wildcards')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="2" v-model='radioValue'>
每年
{{$t('schedule.cron.every')}}{{$t('schedule.cron.years')}}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="3" v-model='radioValue'>
周期从
<el-input-number v-model='cycle01' :min='fullYear' /> -
{{$t('schedule.cron.period')}} {{$t('schedule.cron.from')}}
<el-input-number v-model='cycle01' :min='fullYear' /> -
<el-input-number v-model='cycle02' :min='fullYear' />
</el-radio>
</el-form-item>
<el-form-item>
<el-radio :label="4" v-model='radioValue'>
<el-input-number v-model='average01' :min='fullYear' /> 年开始
<el-input-number v-model='average02' :min='fullYear' /> 年执行一次
{{$t('schedule.cron.from')}}
<el-input-number v-model='average01' :min='fullYear' /> {{$t('schedule.cron.years')}}{{$t('schedule.cron.start')}}{{$t('schedule.cron.every')}}
<el-input-number v-model='average02' :min='fullYear' /> {{$t('schedule.cron.years')}}{{$t('schedule.cron.execute_once')}}
</el-radio>
</el-form-item>
@ -32,7 +32,7 @@
<el-form-item>
<el-radio :label="5" v-model='radioValue'>
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple>
<el-select clearable v-model="checkboxList" :placeholder="$t('schedule.cron.multi_select')" multiple>
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
</el-select>
</el-radio>

View File

@ -268,7 +268,7 @@
url = '/performance/schedule/update';
}
this.$post(url, param, response => {
this.$success('保存成功');
this.$success(this.$t('commons.save_success'));
this.getTest(this.testPlan.id);
});
},

View File

@ -96,7 +96,7 @@
param.testCaseIds = [...this.selectIds];
this.$post('/test/plan/relevance' , param, () => {
this.selectIds.clear();
this.$success("保存成功");
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
this.$emit('refresh');
});

View File

@ -101,6 +101,8 @@ export default {
'delete_confirm': 'Please enter the following to confirm deletion:',
'login_username': 'ID or email',
'input_login_username': 'Please input the user ID or email',
'input_name': 'Please enter name',
'formatErr': 'Format Error'
},
workspace: {
'create': 'Create Workspace',
@ -294,6 +296,15 @@ export default {
value: "Value",
create_performance_test: "Create Performance Test",
export_config: "Export Configuration",
environment: {
name: "Environment Name",
socket: "Socket",
globalVariable: "Global Variable",
environment_list: "Environment List",
environment_config: "Environment Config",
environment: "Environment",
please_save_test: "Please Save Test First",
},
scenario: {
config: "Scenario Config",
input_name: "Please enter the scenario name",
@ -314,7 +325,13 @@ export default {
name: "Name",
method: "Method",
url: "URL",
path: "Path",
address: "Address",
refer_to_environment: "Use Environment",
please_configure_environment_in_scenario: "Please Configure Environment In The Scenario",
please_add_environment_to_scenario: "Please Add The Environment Configuration To The Scenario First",
url_description: "etc: https://fit2cloud.com",
path_description: "etc/login",
parameters: "Query parameters",
parameters_desc: "Parameters will be appended to the URL e.g. https://fit2cloud.com?Name=Value&Name2=Value2",
headers: "Headers",
@ -591,5 +608,46 @@ export default {
'dn_cannot_be_empty': 'LDAP DN cannot be empty',
'ou_cannot_be_empty': 'LDAP OU cannot be empty',
'password_cannot_be_empty': 'LDAP password cannot be empty',
}
},
schedule: {
not_set: "Not Set",
next_execution_time: "Next Execution Time",
edit_timer_task: "Edit Timer Task",
please_input_cron_expression: "Please Input Cron Expression",
generate_expression: "Generate Expression",
cron_expression_format_error: "Cron Expression Format Error",
cron_expression_interval_short_error: "Interval Time Should Longer than 5 Minutes",
cron: {
seconds: "Seconds",
minutes: "Minutes",
hours: "Hours",
day: "Day",
month: "Month",
weeks: "Weeks",
years: "Years",
week: "Week",
time_expression: "Time Expression",
complete_expression: "Complete Expression",
allowed_wildcards: "Allowed Wildcards[, - * /]",
day_allowed_wildcards: "Allowed Wildcards[, - * / L M]",
weeks_allowed_wildcards: "Allowed Wildcards[, - * / L M]",
not_specify: "Not Specify",
specify: "Specify",
period: "Period",
from: "From",
every: "Every",
day_unit: "Day Unit",
start: "Start",
execute_once: "Execute Once",
last_working_day: "The Last Working Day",
last_day_of_the_month: "The Last Day Of The Month",
multi_select: "Multi Select",
num: "Number",
week_of_weeks: "Week Of Weeks",
last_week_of_the_month: "The Last Week Of The Month",
not_fill: "Not Fill",
recent_run_time: "Recent 5th Runing Time",
no_qualifying_results: "No Qualifying Results",
}
},
};

View File

@ -101,6 +101,8 @@ export default {
'delete_confirm': '请输入以下内容,确认删除:',
'login_username': 'ID 或 邮箱',
'input_login_username': '请输入用户 ID 或 邮箱',
'input_name': '请输入名称',
'formatErr': '格式错误'
},
workspace: {
'create': '创建工作空间',
@ -292,6 +294,15 @@ export default {
value: "值",
create_performance_test: "创建性能测试",
export_config: "导出配置",
environment: {
name: "环境名称",
socket: "环境域名",
globalVariable: "全局变量",
environment_list: "环境列表",
environment_config: "环境配置",
environment: "环境",
please_save_test: "请先保存测试",
},
scenario: {
config: "场景配置",
input_name: "请输入场景名称",
@ -311,7 +322,13 @@ export default {
name: "请求名称",
method: "请求方法",
url: "请求URL",
url_description: "例如: https://fit2cloud.com",
path: "请求路径",
address: "请求地址",
refer_to_environment: "引用环境",
please_configure_environment_in_scenario: "请在场景中配置环境",
please_add_environment_to_scenario: "请先在场景中添加环境配置",
url_description: "例如https://fit2cloud.com",
path_description: "例如:/login",
url_invalid: "URL无效",
parameters: "请求参数",
parameters_desc: "参数追加到URL例如https://fit2cloud.com/entries?key1=Value1&Key2=Value2",
@ -588,5 +605,46 @@ export default {
'dn_cannot_be_empty': 'LDAP DN不能为空',
'ou_cannot_be_empty': 'LDAP OU不能为空',
'password_cannot_be_empty': 'LDAP 密码不能为空',
}
},
schedule: {
not_set: "未设置",
next_execution_time: "下次执行时间",
edit_timer_task: "编辑定时任务",
please_input_cron_expression: "请输入 Cron 表达式",
generate_expression: "生成表达式",
cron_expression_format_error: "Cron 表达式格式错误",
cron_expression_interval_short_error: "间隔时间请大于 5 分钟",
cron: {
seconds: "秒",
minutes: "分钟",
hours: "小时",
day: "日",
month: "月",
weeks: "周",
years: "年",
week: "星期",
time_expression: "时间表达式",
complete_expression: "完整表达式",
allowed_wildcards: "允许的通配符[, - * /]",
day_allowed_wildcards: "允许的通配符[, - * / L M]",
weeks_allowed_wildcards: "允许的通配符[, - * / L M]",
not_specify: "不指定",
specify: "指定",
period: "周期",
from: "从",
every: "每",
day_unit: "号",
start: "开始",
execute_once: "执行一次",
last_working_day: "最近的那个工作日",
last_day_of_the_month: "本月最后一天",
multi_select: "可多选",
num: "第",
week_of_weeks: "周的星期",
last_week_of_the_month: "本月最后一个星期",
not_fill: "不填",
recent_run_time: "最近5次运行时间",
no_qualifying_results: "没有达到条件的结果",
}
},
};

View File

@ -99,6 +99,8 @@ export default {
'not_performed_yet': '尚未執行',
'incorrect_input': '輸入內容不正確',
'delete_confirm': '請輸入以下內容,確認刪除:',
'input_name': '請輸入名稱',
'formatErr': '格式錯誤'
},
workspace: {
'create': '創建工作空間',
@ -291,6 +293,15 @@ export default {
value: "值",
create_performance_test: "創建性能測試",
export_config: "匯出配寘",
environment: {
name: "環境名稱",
socket: "環境域名",
globalVariable: "全局變量",
environment_list: "環境列表",
environment_config: "環境配置",
environment: "環境",
please_save_test: "請先保存測試",
},
scenario: {
creator: "創建人",
config: "場景配寘",
@ -311,7 +322,13 @@ export default {
name: "請求名稱",
method: "請求方法",
url: "請求URL",
path: "請求路徑",
address: "請求地址",
refer_to_environment: "引用環境",
please_configure_environment_in_scenario: "請在場景中配置環境",
please_add_environment_to_scenario: "請先在場景中添加環境配置",
url_description: "例如https://fit2cloud.com",
path_description: "例如:/login",
url_invalid: "URL無效",
parameters: "請求參數",
parameters_desc: "參數追加到URL,例如https://fit2cloud.com/entrieskey1=Value1&amp;Key2=Value2",
@ -588,5 +605,46 @@ export default {
'dn_cannot_be_empty': 'LDAP DN不能為空',
'ou_cannot_be_empty': 'LDAP OU不能為空',
'password_cannot_be_empty': 'LDAP 密碼不能為空',
}
},
schedule: {
not_set: "未設置",
next_execution_time: "下次執行時間",
edit_timer_task: "編輯定時任務",
please_input_cron_expression: "請輸入 Cron 表達式",
generate_expression: "生成表達式",
cron_expression_format_error: "Cron 表達式格式錯誤",
cron_expression_interval_short_error: "間隔時間請大於 5 分鐘",
cron: {
seconds: "秒",
minutes: "分鐘",
hours: "小時",
day: "日",
month: "月",
weeks: "周",
years: "年",
week: "星期",
time_expression: "時間表達式",
complete_expression: "完整表達式",
allowed_wildcards: "允許的通配符[, - * /]",
day_allowed_wildcards: "允許的通配符[, - * / L M]",
weeks_allowed_wildcards: "允許的通配符[, - * / L M]",
not_specify: "不指定",
specify: "指定",
period: "周期",
from: "從",
every: "每",
day_unit: "號",
start: "開始",
execute_once: "執行壹次",
last_working_day: "最近的那個工作日",
last_day_of_the_month: "本月最後壹天",
multi_select: "可多選",
num: "第",
week_of_weeks: "周的星期",
last_week_of_the_month: "本月最後壹個星期",
not_fill: "不填",
recent_run_time: "最近5次運行時間",
no_qualifying_results: "沒有達到條件的結果",
}
},
};