refactor(性能测试): 页面修改

This commit is contained in:
CaptainB 2021-11-13 16:51:22 +08:00 committed by 刘瑞斌
parent fcc0dc579b
commit 32f471627d
5 changed files with 36 additions and 40 deletions

View File

@ -6,30 +6,28 @@
<el-form-item :label="$t('load_test.select_resource_pool')">
<el-select v-model="resourcePool" :disabled="isReadOnly" size="mini" @change="resourcePoolChange">
<el-option
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.performance"
:value="item.id">
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.performance"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('load_test.serialize_threadgroups')">
<el-switch v-model="serializeThreadGroups"/>
</el-form-item>
<br>
<el-form-item :label="$t('load_test.autostop_threadgroups')">
<el-switch v-model="autoStop"/>
</el-form-item>
<el-form-item :label="$t('load_test.reaches_duration')">
<el-form-item v-if="autoStop" :label="$t('load_test.reaches_duration')">
<el-input-number controls-position="right"
:disabled="isReadOnly || !autoStop"
:disabled="isReadOnly"
v-model="autoStopDelay"
:min="1"
:max="9999"
size="mini"/>
</el-form-item>
<el-form-item :label="$t('load_test.autostop_delay')"/>
</el-form>
</el-col>
</el-row>
@ -83,10 +81,10 @@
<el-form-item :label="$t('load_test.on_sample_error')">
<el-select v-model="threadGroup.onSampleError" :disabled="isReadOnly" size="mini">
<el-option
v-for="item in onSampleErrors"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in onSampleErrors"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
@ -222,10 +220,10 @@
<el-form-item :label="$t('load_test.specify_resource')">
<el-select v-model="threadGroup.resourceNodeIndex" :disabled="isReadOnly" size="mini">
<el-option
v-for="(node, index) in resourceNodes"
:key="node.ip"
:label="node.ip"
:value="index">
v-for="(node, index) in resourceNodes"
:key="node.ip"
:label="node.ip"
:value="index">
</el-option>
</el-select>
</el-form-item>
@ -289,7 +287,7 @@ const RATIOS = "ratios";
const hexToRgb = function (hex) {
return 'rgb(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5))
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
};
export default {
@ -572,8 +570,8 @@ export default {
let tg = handler.threadGroups[i];
if (tg.enabled === 'false' ||
tg.deleted === 'true' ||
tg.threadType === 'ITERATION') {
tg.deleted === 'true' ||
tg.threadType === 'ITERATION') {
continue;
}
if (this.getDuration(tg) < tg.rampUpTime) {
@ -688,7 +686,7 @@ export default {
}
if (!tg.threadNumber || !tg.duration
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
this.$warning(this.$t('load_test.pressure_config_params_is_empty'));
this.$emit('changeActive', '1');
return false;

View File

@ -17,19 +17,17 @@
<el-form-item :label="$t('load_test.serialize_threadgroups')">
<el-switch v-model="serializeThreadGroups"/>
</el-form-item>
<br>
<el-form-item :label="$t('load_test.autostop_threadgroups')">
<el-switch v-model="autoStop"/>
</el-form-item>
<el-form-item :label="$t('load_test.reaches_duration')">
<el-input-number
:disabled="isReadOnly || !autoStop"
v-model="autoStopDelay"
:min="1"
:max="9999"
size="mini"/>
<el-form-item v-if="autoStop" :label="$t('load_test.reaches_duration')">
<el-input-number controls-position="right"
:disabled="isReadOnly"
v-model="autoStopDelay"
:min="1"
:max="9999"
size="mini"/>
</el-form-item>
<el-form-item :label="$t('load_test.autostop_delay')"/>
</el-form>
</el-col>
</el-row>

View File

@ -822,8 +822,8 @@ export default {
response_timeout: 'Timeout to response',
custom_http_code: 'Custom HTTP response success status code',
separated_by_commas: 'Separated by commas',
serialize_threadgroups: 'Whether the scene is executed sequentially',
autostop_threadgroups: 'Auto stop enable',
serialize_threadgroups: 'ThreadGroup Sequentially',
autostop_threadgroups: 'Auto stop',
reaches_duration: 'Delay',
autostop_delay: 'seconds before stopping the test',
create: 'Create Test',

View File

@ -829,10 +829,10 @@ export default {
separated_by_commas: '按逗号分隔',
create: '创建测试',
run: '一键运行',
select_resource_pool: '请选择资源池',
serialize_threadgroups: '场景是否顺序执行',
autostop_threadgroups: '自动停止开启',
reaches_duration: '到达执行时间',
select_resource_pool: '资源池',
serialize_threadgroups: '顺序执行场景',
autostop_threadgroups: '自动停止',
reaches_duration: '延迟时间',
autostop_delay: '秒后停止测试',
resource_pool_is_null: '资源池为空',
download_log_file: '下载完整日志文件',

View File

@ -827,10 +827,10 @@ export default {
separated_by_commas: '按逗號分隔',
create: '創建測試',
run: '一鍵運行',
select_resource_pool: '請選擇資源池',
serialize_threadgroups: '場景是否順序執行',
autostop_threadgroups: '自動停止開啟',
reaches_duration: '到達執行時間',
select_resource_pool: '資源池',
serialize_threadgroups: '順序執行場景',
autostop_threadgroups: '自動停止',
reaches_duration: '延遲時間',
autostop_delay: '秒後停止測試',
resource_pool_is_null: '資源池為空',
download_log_file: '下載完整日誌文件',