Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
3a443e4f
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,体验更适合开发者的 AI 搜索 >>
提交
3a443e4f
编写于
5月 26, 2021
作者:
F
fit2-zhao
提交者:
fit2-zhao
5月 26, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(系统设置): 操作日志放到 系统,组织,工作空间,项目 下根据不同的权限加载。
上级
ea6ef2ab
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
124 addition
and
22 deletion
+124
-22
backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml
.../io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml
+4
-0
backend/src/main/java/io/metersphere/log/vo/OperatingLogRequest.java
.../main/java/io/metersphere/log/vo/OperatingLogRequest.java
+3
-0
frontend/src/business/components/api/automation/report/components/MetricChart.vue
...mponents/api/automation/report/components/MetricChart.vue
+33
-2
frontend/src/business/components/settings/operatinglog/OperatingLog.vue
...usiness/components/settings/operatinglog/OperatingLog.vue
+64
-18
frontend/src/business/components/settings/router.js
frontend/src/business/components/settings/router.js
+20
-2
未找到文件。
backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml
浏览文件 @
3a443e4f
...
...
@@ -20,6 +20,10 @@
LEFT JOIN project t2 ON t.project_id = t2.id
LEFT JOIN workspace w on t2.workspace_id = w.id
<where>
t.project_id in
<foreach
collection=
"request.projectIds"
item=
"projectId"
separator=
","
open=
"("
close=
")"
>
#{projectId}
</foreach>
<if
test=
"request.operUser != null and request.operUser != ''"
>
and t.oper_user like #{request.operUser, jdbcType=VARCHAR}
or t1.NAME like #{request.operUser, jdbcType=VARCHAR}
...
...
backend/src/main/java/io/metersphere/log/vo/OperatingLogRequest.java
浏览文件 @
3a443e4f
...
...
@@ -27,4 +27,7 @@ public class OperatingLogRequest implements Serializable {
private
String
operTitle
;
private
List
<
Long
>
times
;
private
List
<
String
>
projectIds
;
}
\ No newline at end of file
frontend/src/business/components/api/automation/report/components/MetricChart.vue
浏览文件 @
3a443e4f
...
...
@@ -9,7 +9,13 @@
</div>
</el-row>
<ms-chart
id=
"chart"
ref=
"chart"
:options=
"options"
:autoresize=
"true"
></ms-chart>
<!--
<ms-chart
id=
"chart"
ref=
"chart"
:options=
"options"
:autoresize=
"true"
></ms-chart>
-->
<span
class=
"ms-req ms-req-error"
v-if=
"content.error && content.error>0"
>
<span
class=
"ms-req-span"
>
{{
content
.
success
+
content
.
error
}}
请求
</span>
</span>
<span
class=
"ms-req ms-req-success"
v-else
>
<span
class=
"ms-req-span"
>
{{
content
.
success
?
content
.
success
+
content
.
error
:
0
}}
请求
</span>
</span>
<el-row
type=
"flex"
justify=
"center"
align=
"middle"
>
<i
class=
"circle success"
/>
<div
class=
"metric-box"
>
...
...
@@ -92,10 +98,11 @@
scenarioTotal
:
0
,
scenarioSuccess
:
0
,
scenarioError
:
0
,
reqTotal
:
0
,
}
},
created
()
{
this
.
initTime
()
this
.
initTime
()
;
},
methods
:
{
initTime
()
{
...
...
@@ -279,4 +286,28 @@
font-size
:
40px
;
}
.ms-req
{
border-radius
:
50%
;
height
:
110px
;
width
:
110px
;
display
:
inline-block
;
vertical-align
:
top
;
margin-right
:
30px
;
}
.ms-req-error
{
border
:
5px
#F56C6C
solid
;
}
.ms-req-success
{
border
:
5px
#67C23A
solid
;
}
.ms-req-span
{
display
:
block
;
color
:
black
;
height
:
110px
;
line-height
:
110px
;
text-align
:
center
;
}
</
style
>
frontend/src/business/components/settings/operatinglog/OperatingLog.vue
浏览文件 @
3a443e4f
...
...
@@ -29,7 +29,7 @@
<el-col
:span=
"4"
>
<el-form-item
:label=
"$t('commons.project')"
prop=
"project"
>
<el-select
size=
"small"
v-model=
"condition.projectId"
clearable
>
<el-select
size=
"small"
v-model=
"condition.projectId"
@
change=
"initTableData"
clearable
>
<el-option
v-for=
"o in items"
:key=
"o.id"
:label=
"$t(o.label)"
:value=
"o.id"
/>
</el-select>
</el-form-item>
...
...
@@ -37,7 +37,7 @@
<el-col
:span=
"4"
>
<el-form-item
:label=
"$t('operating_log.type')"
prop=
"type"
>
<el-select
size=
"small"
v-model=
"condition.operType"
clearable
>
<el-select
size=
"small"
v-model=
"condition.operType"
clearable
@
change=
"initTableData"
>
<el-option
v-for=
"o in LOG_TYPE"
:key=
"o.id"
:label=
"$t(o.label)"
:value=
"o.id"
/>
</el-select>
</el-form-item>
...
...
@@ -165,9 +165,39 @@
])
}
},
created
()
{
this
.
initTableData
();
this
.
initProject
();
mounted
()
{
switch
(
this
.
$route
.
name
)
{
case
"
system
"
:
this
.
initProject
(
"
/project/listAll
"
);
break
;
case
"
organization
"
:
this
.
initProject
(
"
/project/listAll/
"
+
getCurrentUser
().
lastWorkspaceId
);
break
;
case
"
workspace
"
:
this
.
initProject
(
"
/project/listAll/
"
+
getCurrentUser
().
lastWorkspaceId
);
break
;
case
"
project
"
:
this
.
getProject
();
break
;
}
},
watch
:
{
'
$route
'
(
to
,
from
)
{
switch
(
to
.
name
)
{
case
"
system
"
:
this
.
initProject
(
"
/project/listAll
"
);
break
;
case
"
organization
"
:
this
.
initProject
(
"
/project/listAll/
"
+
getCurrentUser
().
lastWorkspaceId
);
break
;
case
"
workspace
"
:
this
.
initProject
(
"
/project/listAll/
"
+
getCurrentUser
().
lastWorkspaceId
);
break
;
case
"
project
"
:
this
.
getProject
();
break
;
}
}
},
methods
:
{
initTableData
()
{
...
...
@@ -179,22 +209,38 @@
this
.
result
.
loading
=
false
;
})
},
reset
()
{
let
projectIds
=
this
.
condition
.
projectIds
;
this
.
condition
=
{
projectIds
:
projectIds
};
this
.
initTableData
();
},
initProject
(
url
)
{
this
.
condition
=
{};
this
.
result
=
this
.
$get
(
url
,
response
=>
{
let
projects
=
response
.
data
;
let
projectIds
=
[];
if
(
projects
)
{
this
.
items
=
[];
projects
.
forEach
(
item
=>
{
let
data
=
{
id
:
item
.
id
,
label
:
item
.
name
};
this
.
items
.
push
(
data
);
projectIds
.
push
(
item
.
id
);
})
}
this
.
condition
.
projectIds
=
projectIds
;
this
.
initTableData
();
})
},
initProject
()
{
if
(
hasRoles
(
ROLE_TEST_VIEWER
,
ROLE_TEST_USER
,
ROLE_TEST_MANAGER
))
{
this
.
result
=
this
.
$get
(
"
/project/listAll
"
,
response
=>
{
let
projects
=
response
.
data
;
if
(
projects
)
{
this
.
items
=
[];
projects
.
forEach
(
item
=>
{
let
data
=
{
id
:
item
.
id
,
label
:
item
.
name
};
this
.
items
.
push
(
data
);
})
}
})
}
getProject
()
{
this
.
condition
.
projectIds
=
[];
this
.
result
=
this
.
$get
(
"
/project/get/
"
+
this
.
$store
.
state
.
projectId
,
response
=>
{
let
project
=
response
.
data
;
this
.
items
=
[{
id
:
project
.
id
,
label
:
project
.
name
}];
this
.
condition
.
projectIds
=
[
project
.
id
];
this
.
condition
.
projectId
=
project
.
id
;
this
.
initTableData
();
})
},
getType
(
type
)
{
return
this
.
LOG_TYPE_MAP
.
get
(
type
);
...
...
frontend/src/business/components/settings/router.js
浏览文件 @
3a443e4f
...
...
@@ -129,10 +129,28 @@ export default {
meta
:
{
project
:
true
,
title
:
'
api_test.environment.environment_config
'
,
permissions
:
[
'
PROJECT_ENVIRONMENT:READ
'
]}
},
{
path
:
'
operatingLog
'
,
path
:
'
operatingLog
/system
'
,
component
:
()
=>
import
(
'
@/business/components/settings/operatinglog/OperatingLog
'
),
name
:
'
system
'
,
meta
:
{
system
:
true
,
title
:
'
operating_log.title
'
,
permissions
:
[
'
SYSTEM_OPERATING_LOG:READ
'
]}
},
{
path
:
'
operatingLog/organization
'
,
component
:
()
=>
import
(
'
@/business/components/settings/operatinglog/OperatingLog
'
),
name
:
'
organization
'
,
meta
:
{
organization
:
true
,
title
:
'
operating_log.title
'
,
permissions
:
[
'
SYSTEM_OPERATING_LOG:READ
'
]}
},
{
path
:
'
operatingLog/workspace
'
,
component
:
()
=>
import
(
'
@/business/components/settings/operatinglog/OperatingLog
'
),
name
:
'
workspace
'
,
meta
:
{
workspace
:
true
,
title
:
'
operating_log.title
'
,
permissions
:
[
'
SYSTEM_OPERATING_LOG:READ
'
]}
},
{
path
:
'
operatingLog/project
'
,
name
:
'
project
'
,
component
:
()
=>
import
(
'
@/business/components/settings/operatinglog/OperatingLog
'
),
meta
:
{
project
:
true
,
title
:
'
operating_log.title
'
,
permissions
:
[
'
SYSTEM_OPERATING_LOG:READ
'
]}
}
]
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录