Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
9759d4fe
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,发现更多精彩内容 >>
提交
9759d4fe
编写于
4月 01, 2021
作者:
F
fit2-zhao
提交者:
刘瑞斌
4月 01, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(接口自动化): 场景变量国际化修改
上级
2a376889
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
27 deletion
+33
-27
backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java
...pi/dto/definition/request/sampler/MsHTTPSamplerProxy.java
+6
-9
backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java
...a/io/metersphere/api/jmeter/APIBackendListenerClient.java
+1
-1
frontend/src/business/components/api/automation/scenario/variable/VariableList.vue
...ponents/api/automation/scenario/variable/VariableList.vue
+17
-17
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/i18n/zh-TW.js
frontend/src/i18n/zh-TW.js
+3
-0
未找到文件。
backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java
浏览文件 @
9759d4fe
...
...
@@ -351,16 +351,13 @@ public class MsHTTPSamplerProxy extends MsTestElement {
public
boolean
isURL
(
String
str
)
{
try
{
String
regex
=
"^((https|http|ftp|rtsp|mms)?://)"
+
"?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?"
+
"(([0-9]{1,3}\\.){3}[0-9]{1,3}"
+
"|"
+
"([0-9a-z_!~*'()-]+\\.)*"
+
"([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\."
+
"[a-z]{2,6})"
+
"(:[0-9]{1,5})?"
+
"((/?)|"
+
"(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"
;
return
str
.
matches
(
regex
)
||
(
str
.
matches
(
"^(http|https|ftp)://.*$"
)
&&
str
.
matches
(
".*://\\$\\{.*$"
));
new
URL
(
str
);
return
true
;
}
catch
(
Exception
e
)
{
// 支持包含变量的url
if
(
str
.
matches
(
"^(http|https|ftp)://.*$"
)
&&
str
.
matches
(
".*://\\$\\{.*$"
))
{
return
true
;
}
return
false
;
}
}
...
...
backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java
浏览文件 @
9759d4fe
...
...
@@ -247,7 +247,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
}
}
if
(
StringUtils
.
equals
(
ReportTriggerMode
.
API
.
name
(),
report
.
getTriggerMode
())||
StringUtils
.
equals
(
ReportTriggerMode
.
SCHEDULE
.
name
(),
report
.
getTriggerMode
()))
{
if
(
report
!=
null
&&
StringUtils
.
equals
(
ReportTriggerMode
.
API
.
name
(),
report
.
getTriggerMode
())||
StringUtils
.
equals
(
ReportTriggerMode
.
SCHEDULE
.
name
(),
report
.
getTriggerMode
()))
{
sendTask
(
report
,
reportUrl
,
testResult
);
}
...
...
frontend/src/business/components/api/automation/scenario/variable/VariableList.vue
浏览文件 @
9759d4fe
<
template
>
<el-dialog
title=
"场景变量
"
:close-on-click-modal=
"false"
<el-dialog
:title=
"$t('api_test.automation.step_total')
"
:close-on-click-modal=
"false"
:visible.sync=
"visible"
class=
"visible-dialog"
width=
"60%"
@
close=
"close"
v-loading=
"loading"
append-to-body
>
<fieldset
:disabled=
"disabled"
class=
"ms-fieldset"
>
...
...
@@ -10,14 +10,14 @@
<div>
<el-row
style=
"margin-bottom: 10px"
>
<div
style=
"float: left"
>
<el-input
placeholder=
"变量名称搜索
"
v-model=
"selectVariable"
size=
"small"
@
change=
"filter"
<el-input
:placeholder=
"$t('commons.search_by_name')
"
v-model=
"selectVariable"
size=
"small"
@
change=
"filter"
@
keyup.enter=
"filter"
>
<el-select
v-model=
"searchType"
slot=
"prepend"
placeholder=
"类型
"
style=
"width: 90px"
@
change=
"filter"
>
<el-option
value=
"CONSTANT"
label=
"常量
"
></el-option>
<el-option
value=
"LIST"
label=
"列表
"
></el-option>
<el-select
v-model=
"searchType"
slot=
"prepend"
:placeholder=
"$t('test_resource_pool.type')
"
style=
"width: 90px"
@
change=
"filter"
>
<el-option
value=
"CONSTANT"
:label=
"$t('api_test.automation.constant')
"
></el-option>
<el-option
value=
"LIST"
:label=
"$t('test_track.case.list')
"
></el-option>
<el-option
value=
"CSV"
label=
"CSV"
></el-option>
<el-option
value=
"COUNTER"
label=
"计数器
"
></el-option>
<el-option
value=
"RANDOM"
label=
"随机数
"
></el-option>
<el-option
value=
"COUNTER"
:label=
"$t('api_test.automation.counter')
"
></el-option>
<el-option
value=
"RANDOM"
:label=
"$t('api_test.automation.random')
"
></el-option>
</el-select>
</el-input>
</div>
...
...
@@ -27,11 +27,11 @@
size=
"small"
style=
"margin-left: 10px"
>
{{
$t
(
'
commons.add
'
)
}}
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"CONSTANT"
>
常量
</el-dropdown-item>
<el-dropdown-item
command=
"LIST"
>
列表
</el-dropdown-item>
<el-dropdown-item
command=
"CONSTANT"
>
{{
$t
(
'
api_test.automation.constant
'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"LIST"
>
{{
$t
(
'
test_track.case.list
'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"CSV"
>
CSV
</el-dropdown-item>
<el-dropdown-item
command=
"COUNTER"
>
计数器
</el-dropdown-item>
<el-dropdown-item
command=
"RANDOM"
>
随机数
</el-dropdown-item>
<el-dropdown-item
command=
"COUNTER"
>
{{
$t
(
'
api_test.automation.counter
'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"RANDOM"
>
{{
$t
(
'
api_test.automation.random
'
)
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button
size=
"small"
style=
"margin-left: 10px"
@
click=
"deleteVariable"
>
{{
$t
(
'
commons.delete
'
)
}}
...
...
@@ -137,11 +137,11 @@
selectVariable
:
""
,
condition
:
{},
types
:
new
Map
([
[
'
CONSTANT
'
,
'
常量
'
],
[
'
LIST
'
,
'
列表
'
],
[
'
CONSTANT
'
,
this
.
$t
(
'
api_test.automation.constant
'
)
],
[
'
LIST
'
,
this
.
$t
(
'
test_track.case.list
'
)
],
[
'
CSV
'
,
'
CSV
'
],
[
'
COUNTER
'
,
'
计数器
'
],
[
'
RANDOM
'
,
'
随机数
'
]
[
'
COUNTER
'
,
this
.
$t
(
'
api_test.automation.counter
'
)
],
[
'
RANDOM
'
,
this
.
$t
(
'
api_test.automation.random
'
)
]
]),
visible
:
false
,
selection
:
[],
...
...
@@ -187,7 +187,7 @@
}
},
handleClick
(
command
)
{
this
.
editData
=
{};
this
.
editData
=
{
delimiter
:
"
,
"
};
this
.
editData
.
type
=
command
;
this
.
addParameters
(
this
.
editData
);
},
...
...
@@ -226,7 +226,7 @@
this
.
headers
=
headers
;
}
this
.
visible
=
true
;
this
.
editData
=
{
type
:
"
CONSTANT
"
,
delimiter
:
"
,
"
};
this
.
editData
=
{
type
:
"
CONSTANT
"
};
this
.
addParameters
(
this
.
editData
);
this
.
disabled
=
disabled
;
},
...
...
frontend/src/i18n/en-US.js
浏览文件 @
9759d4fe
...
...
@@ -705,6 +705,9 @@ export default {
}
},
automation
:
{
constant
:
"
constant
"
,
counter
:
"
counter
"
,
random
:
"
random
"
,
view_scene_variables
:
"
View scene variables
"
,
open_scene
:
"
Open scene
"
,
save_as_api
:
"
Save as api
"
,
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
9759d4fe
...
...
@@ -706,6 +706,9 @@ export default {
}
},
automation
:
{
constant
:
"
常量
"
,
counter
:
"
计数器
"
,
random
:
"
随机数
"
,
view_scene_variables
:
"
查看场景变量
"
,
open_scene
:
"
打开场景
"
,
save_as_api
:
"
另存为接口定义
"
,
...
...
frontend/src/i18n/zh-TW.js
浏览文件 @
9759d4fe
...
...
@@ -705,6 +705,9 @@ export default {
}
},
automation
:
{
constant
:
"
常量
"
,
counter
:
"
計數器
"
,
random
:
"
随机器
"
,
view_scene_variables
:
"
查看場景變量
"
,
open_scene
:
"
打開場景
"
,
save_as_api
:
"
另存為接口定義
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录