Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
f43a4b96
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f43a4b96
编写于
3月 02, 2020
作者:
C
Captain.B
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
AdvancedConfig
上级
cecebc6f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
56 addition
and
15 deletion
+56
-15
frontend/src/i18n/en-US.js
frontend/src/i18n/en-US.js
+3
-0
frontend/src/i18n/zh-CN.js
frontend/src/i18n/zh-CN.js
+3
-0
frontend/src/performance/components/testPlan/components/AdvancedConfig.vue
...ormance/components/testPlan/components/AdvancedConfig.vue
+50
-15
未找到文件。
frontend/src/i18n/en-US.js
浏览文件 @
f43a4b96
...
...
@@ -97,6 +97,9 @@ export default {
'
param_is_duplicate
'
:
'
Parameter name is duplicate
'
,
'
domain_ip_is_empty
'
:
'
Domain and IP cannot be empty
'
,
'
param_name_value_is_empty
'
:
'
Parameters cannot be empty
'
,
'
connect_timeout
'
:
'
Timeout to establish a connection
'
,
'
custom_http_code
'
:
'
Custom HTTP response success status code
'
,
'
separated_by_commas
'
:
'
Separated by commas
'
,
},
i18n
:
{
'
home
'
:
'
Home
'
,
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
f43a4b96
...
...
@@ -97,6 +97,9 @@ export default {
'
param_is_duplicate
'
:
'
参数名不能重复
'
,
'
domain_ip_is_empty
'
:
'
域名和IP不能为空
'
,
'
param_name_value_is_empty
'
:
'
参数名和参数值不能为空
'
,
'
connect_timeout
'
:
'
建立连接超时时间
'
,
'
custom_http_code
'
:
'
自定义 HTTP 响应成功状态码
'
,
'
separated_by_commas
'
:
'
按逗号分隔
'
,
},
i18n
:
{
'
home
'
:
'
首页
'
,
...
...
frontend/src/performance/components/testPlan/components/AdvancedConfig.vue
浏览文件 @
f43a4b96
...
...
@@ -170,12 +170,29 @@
<el-row>
<el-col
:span=
"8"
>
建立连接超时时间 {{timeout}} ms
<el-form
:inline=
"true"
>
<el-form-item>
<div>
{{$t('load_test.connect_timeout')}}
</div>
</el-form-item>
<el-form-item>
<el-input-number
size=
"mini"
v-model=
"timeout"
:min=
"10"
:max=
"100000"
></el-input-number>
</el-form-item>
<el-form-item>
ms
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
自定义 HTTP 响应成功状态码 {{statusCode}}
<el-form
:inline=
"true"
>
<el-form-item>
<div>
{{$t('load_test.custom_http_code')}}
</div>
</el-form-item>
<el-form-item>
<el-input
size=
"mini"
v-model=
"statusCodeStr"
:placeholder=
"$t('load_test.separated_by_commas')"
@
input=
"checkStatusCode"
></el-input>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
...
...
@@ -187,25 +204,24 @@
data
()
{
return
{
timeout
:
10
,
statusCode
:
[
302
],
statusCode
:
[],
domains
:
[],
params
:
[],
statusCodeStr
:
''
,
}
},
mounted
()
{
let
testId
=
this
.
$route
.
path
.
split
(
'
/
'
)[
2
];
if
(
testId
)
{
this
.
$get
(
'
/testplan/get-advanced-config/
'
+
testId
,
(
response
)
=>
{
if
(
response
.
data
)
{
let
data
=
JSON
.
parse
(
response
.
data
);
this
.
timeout
=
data
.
timeout
||
10
;
this
.
statusCode
=
data
.
statusCode
||
[
302
];
this
.
domains
=
data
.
domains
||
[];
this
.
params
=
data
.
params
||
[];
this
.
domains
.
forEach
(
d
=>
d
.
edit
=
false
);
this
.
params
.
forEach
(
d
=>
d
.
edit
=
false
);
}
});
this
.
getAdvancedConfig
(
testId
);
}
},
watch
:
{
'
$route
'
(
to
)
{
let
testId
=
to
.
path
.
split
(
'
/
'
)[
2
];
if
(
testId
)
{
this
.
getAdvancedConfig
(
testId
);
}
}
},
methods
:
{
...
...
@@ -224,6 +240,20 @@
delete
row
[
key
+
'
Origin
'
];
});
},
getAdvancedConfig
(
testId
)
{
this
.
$get
(
'
/testplan/get-advanced-config/
'
+
testId
,
(
response
)
=>
{
if
(
response
.
data
)
{
let
data
=
JSON
.
parse
(
response
.
data
);
this
.
timeout
=
data
.
timeout
||
10
;
this
.
statusCode
=
data
.
statusCode
||
[];
this
.
statusCodeStr
=
this
.
statusCode
.
join
(
'
,
'
);
this
.
domains
=
data
.
domains
||
[];
this
.
params
=
data
.
params
||
[];
this
.
domains
.
forEach
(
d
=>
d
.
edit
=
false
);
this
.
params
.
forEach
(
d
=>
d
.
edit
=
false
);
}
});
},
add
(
dataName
)
{
if
(
dataName
===
'
domains
'
)
{
this
[
dataName
].
push
({
...
...
@@ -293,6 +323,11 @@
}
return
true
;
},
checkStatusCode
()
{
let
license_num
=
this
.
statusCodeStr
;
license_num
=
license_num
.
replace
(
/
[^\d
,
]
/g
,
''
);
// 清除“数字”和“.”以外的字符
this
.
statusCodeStr
=
license_num
;
},
cancelAllEdit
()
{
this
.
domains
.
forEach
(
d
=>
d
.
edit
=
false
);
this
.
params
.
forEach
(
d
=>
d
.
edit
=
false
);
...
...
@@ -302,7 +337,7 @@
this
.
params
.
forEach
(
d
=>
this
.
delOriginObject
(
d
));
return
{
timeout
:
this
.
timeout
,
statusCode
:
this
.
statusCode
,
statusCode
:
this
.
statusCode
Str
.
split
(
'
,
'
)
,
params
:
this
.
params
,
domains
:
this
.
domains
,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录