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
74e1c032
Commit
74e1c032
authored
Jul 29, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务监控界面更改
parent
0b6ee248
Pipeline
#32222
skipped with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
index.js
src/pages/log/serviceLog/index.js
+17
-17
No files found.
src/pages/log/serviceLog/index.js
View file @
74e1c032
...
...
@@ -21,14 +21,13 @@ const { Option } = Select;
const
{
Search
}
=
Input
;
const
ServiceLog
=
()
=>
{
const
[
flag
,
setFlag
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
// 源数据
const
[
dataTable
,
setDataTable
]
=
useState
([]);
// 源数据
const
[
visitedCount
,
setVisitedCount
]
=
useState
([]);
// 访问量,统计数据
const
[
pathCount
,
setPathCount
]
=
useState
([]);
// 接口调用次数,统计数据
const
[
reponseTime
,
setReponseTime
]
=
useState
([]);
// 接口调用时长,统计数据
const
[
timeInterval
,
setTimeInterval
]
=
useState
(
'3'
);
// 时间间隔,1/2/3/4(每分钟/5分钟/小时/天),默认每小时
const
[
startTime
,
setStartTime
]
=
useState
(
moment
().
startOf
(
'
day
'
));
// 默认值,当天0点00:00:00
const
[
startTime
,
setStartTime
]
=
useState
(
moment
().
startOf
(
'
week
'
));
// 默认值,当天0点00:00:00
const
[
endTime
,
setEndTime
]
=
useState
(
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
),
// 默认值,当前时间
);
...
...
@@ -142,7 +141,7 @@ const ServiceLog = () => {
)
{
countInterval
();
// 根据起止时间计算时间间隔
}
},
[
startTime
,
endTime
,
flag
]);
},
[
startTime
,
endTime
]);
useEffect
(()
=>
{
if
(
startTime
&&
...
...
@@ -154,7 +153,7 @@ const ServiceLog = () => {
setLoading
(
true
);
getData
(
'/TrafficStatistics'
,
setVisitedCount
);
// 访问量统计
}
},
[
startTime
,
endTime
,
logType
,
timeInterval
,
flag
]);
},
[
startTime
,
endTime
,
logType
,
timeInterval
]);
useEffect
(()
=>
{
if
(
startTime
&&
...
...
@@ -168,7 +167,7 @@ const ServiceLog = () => {
getData
(
'/TopConsumeList'
,
setReponseTime
);
// 接口平均耗时统计
getData
(
'/GetOMSLog'
,
setDataTable
);
// 接口调用记录
}
},
[
startTime
,
endTime
,
logType
,
flag
]);
},
[
startTime
,
endTime
,
logType
]);
// 封装接口请求,参数url/设置方法set
const
getData
=
(
url
,
set
)
=>
{
...
...
@@ -250,7 +249,7 @@ const ServiceLog = () => {
const
handleReset
=
()
=>
{
setLogType
(
'9999'
);
setTimeInterval
(
'3'
);
setStartTime
(
moment
().
startOf
(
'
day
'
));
setStartTime
(
moment
().
startOf
(
'
week
'
));
setEndTime
(
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
));
setSearchWord
(
''
);
}
...
...
@@ -289,17 +288,6 @@ const ServiceLog = () => {
<
Option
value
=
"0"
>
正常
<
/Option
>
<
Option
value
=
"-1"
>
异常
<
/Option
>
<
/Select
>
<
span
style
=
{{
paddingLeft
:
'20px'
}}
>
间隔:
<
/span
>
<
Select
defaultValue
=
"每小时"
value
=
{
timeInterval
}
onChange
=
{
selectChange
}
>
<
Option
value
=
"1"
>
每分钟
<
/Option
>
<
Option
value
=
"2"
>
每
5
分钟
<
/Option
>
<
Option
value
=
"3"
>
每小时
<
/Option
>
<
Option
value
=
"4"
>
每天
<
/Option
>
<
/Select
>
<
Search
allowClear
style
=
{{
width
:
250
,
marginLeft
:
'20px'
}}
...
...
@@ -320,6 +308,18 @@ const ServiceLog = () => {
<
Row
style
=
{{
background
:
'white'
}}
>
<
Col
span
=
{
8
}
style
=
{{
paddingTop
:
'8px'
,
paddingLeft
:
'5px'
}}
>
<
span
style
=
{{
fontSize
:
'14px'
,
fontWeight
:
'600'
}}
>
访问量统计
<
/span
>
<
span
style
=
{{
paddingLeft
:
'60%'
}}
>
间隔:
<
/span
>
<
Select
defaultValue
=
"每小时"
size
=
"small"
value
=
{
timeInterval
}
onChange
=
{
selectChange
}
>
<
Option
value
=
"1"
>
每分钟
<
/Option
>
<
Option
value
=
"2"
>
每
5
分钟
<
/Option
>
<
Option
value
=
"3"
>
每小时
<
/Option
>
<
Option
value
=
"4"
>
每天
<
/Option
>
<
/Select
>
<
/Col
>
<
Col
span
=
{
7
}
offset
=
{
1
}
style
=
{{
paddingTop
:
'8px'
}}
>
<
span
style
=
{{
fontSize
:
'14px'
,
fontWeight
:
'600'
}}
>
接口调用频次统计
<
/span
>
...
...
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