Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
3a0c13bd
Commit
3a0c13bd
authored
Dec 28, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 服务监控tooltip可选中以及状态码中文分类
parent
4b198a8a
Pipeline
#21348
skipped with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
24 deletions
+29
-24
index.js
src/pages/log/serviceLog/index.js
+28
-23
index.js
src/pages/user/login/index.js
+1
-1
No files found.
src/pages/log/serviceLog/index.js
View file @
3a0c13bd
...
...
@@ -27,13 +27,11 @@ const ServiceLog = () => {
const
[
pathCount
,
setPathCount
]
=
useState
([]);
// 接口调用次数,统计数据
const
[
reponseTime
,
setReponseTime
]
=
useState
([]);
// 接口调用时长,统计数据
const
[
timeInterval
,
setTimeInterval
]
=
useState
(
'3'
);
// 时间间隔,1/2/3/4(每分钟/5分钟/小时/天),默认每小时
// const [scale, setScale] = useState({}); // 坐标轴别名
// const [pageSize, setPageSize] = useState(100); // 分页大小
const
[
startTime
,
setStartTime
]
=
useState
(
moment
().
startOf
(
'day'
));
// 默认值,当天0点00:00:00
const
[
endTime
,
setEndTime
]
=
useState
(
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
),
// 默认值,当前时间
);
const
[
logType
,
setLogType
]
=
useState
(
0
);
// 请求参数,日志类型,默认是正常,0:成功 -1:错误
9999:全部
const
[
logType
,
setLogType
]
=
useState
(
-
1
);
// 请求参数,日志类型,默认是正常,0:成功 -1:异常
9999:全部
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
// 关键字
// 计算时间间隔(分钟)
...
...
@@ -79,12 +77,29 @@ const ServiceLog = () => {
title
:
'返回状态'
,
dataIndex
:
'Result'
,
key
:
'Result'
,
// render: record => {
// if (record === 0) {
// return '正常';
// }
// return '错误';
// },
render
:
record
=>
{
let
value
=
''
;
switch
(
record
.
toString
().
charAt
(
0
))
{
case
'1'
:
value
=
'继续请求'
;
break
;
case
'2'
:
value
=
'请求成功'
;
break
;
case
'3'
:
value
=
'重定向'
;
break
;
case
'4'
:
value
=
'客户端错误'
;
break
;
case
'5'
:
value
=
'服务器错误'
;
break
;
default
:
break
;
}
return
value
;
},
},
{
title
:
'错误信息'
,
...
...
@@ -102,16 +117,6 @@ const ServiceLog = () => {
dataIndex
:
'Method'
,
key
:
'Method'
,
},
// {
// title: '查询参数',
// dataIndex: 'QueryString',
// key: 'QueryString',
// },
// {
// title: '请求体',
// dataIndex: 'Body',
// key: 'Body',
// },
{
title
:
'耗时/ms'
,
dataIndex
:
'ConsumerTime'
,
...
...
@@ -257,7 +262,7 @@ const ServiceLog = () => {
<
Button
onClick
=
{()
=>
setTime
(
24
*
60
,
'3'
)}
>
近
1
天
<
/Button
>
<
Button
onClick
=
{()
=>
setTime
(
24
*
7
*
60
,
'4'
)}
>
近
1
周
<
/Button
>
<
span
style
=
{{
marginLeft
:
'20px'
}}
>
返回状态:
<
/span
>
<
Select
defaultValue
=
"
正
常"
onChange
=
{
changeStatus
}
>
<
Select
defaultValue
=
"
异
常"
onChange
=
{
changeStatus
}
>
<
Option
value
=
"9999"
>
全部
<
/Option
>
<
Option
value
=
"0"
>
正常
<
/Option
>
<
Option
value
=
"-1"
>
错误
<
/Option
>
...
...
@@ -309,7 +314,7 @@ const ServiceLog = () => {
<
Axis
name
=
"StartTime"
label
=
""
title
=
{{
offset
:
20
}}
/
>
<
Axis
name
=
"Count"
title
/>
<
Line
shape
=
"smooth"
position
=
"StartTime*Count"
/>
<
Tooltip
shared
/>
<
Tooltip
shared
lock
/>
<
/Chart
>
<
/Col
>
<
Col
span
=
{
7
}
offset
=
{
1
}
>
...
...
@@ -328,7 +333,7 @@ const ServiceLog = () => {
<
Axis
name
=
"Path"
label
=
""
title
=
{{
offset
:
20
}}
/
>
<
Axis
name
=
"Count"
title
/>
<
Interval
position
=
"Path*Count"
/>
<
Tooltip
shared
/>
<
Tooltip
shared
lock
/>
<
/Chart
>
<
/Col
>
<
Col
span
=
{
7
}
offset
=
{
1
}
>
...
...
@@ -347,7 +352,7 @@ const ServiceLog = () => {
<
Axis
name
=
"Path"
label
=
""
title
=
{{
offset
:
20
}}
/
>
<
Axis
name
=
"AvgTime"
title
/>
<
Interval
position
=
"Path*AvgTime"
/>
<
Tooltip
shared
/>
<
Tooltip
shared
lock
/>
<
/Chart
>
<
/Col
>
<
/Row
>
...
...
src/pages/user/login/index.js
View file @
3a0c13bd
...
...
@@ -38,7 +38,7 @@ const Login = props => {
console
.
log
(
values
);
// eg:{userName: "123", password: "123"}
const
{
userName
:
loginName
,
password
}
=
values
;
setLoading
(
true
);
OMSLogin
(
loginName
,
password
,
'CivManage
r
'
)
OMSLogin
(
loginName
,
password
,
'CivManage'
)
.
then
(
result
=>
{
const
{
data
:
{
pass
,
userMode
,
token
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment