Commit 74e1c032 authored by 皮倩雯's avatar 皮倩雯

服务监控界面更改

parent 0b6ee248
Pipeline #32222 skipped with stages
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment