Commit 3a0c13bd authored by 陈前坚's avatar 陈前坚

perf: 服务监控tooltip可选中以及状态码中文分类

parent 4b198a8a
Pipeline #21348 skipped with stages
...@@ -27,13 +27,11 @@ const ServiceLog = () => { ...@@ -27,13 +27,11 @@ const ServiceLog = () => {
const [pathCount, setPathCount] = useState([]); // 接口调用次数,统计数据 const [pathCount, setPathCount] = useState([]); // 接口调用次数,统计数据
const [reponseTime, setReponseTime] = useState([]); // 接口调用时长,统计数据 const [reponseTime, setReponseTime] = useState([]); // 接口调用时长,统计数据
const [timeInterval, setTimeInterval] = useState('3'); // 时间间隔,1/2/3/4(每分钟/5分钟/小时/天),默认每小时 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 [startTime, setStartTime] = useState(moment().startOf('day')); // 默认值,当天0点00:00:00
const [endTime, setEndTime] = useState( const [endTime, setEndTime] = useState(
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值,当前时间 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(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
// 计算时间间隔(分钟) // 计算时间间隔(分钟)
...@@ -79,12 +77,29 @@ const ServiceLog = () => { ...@@ -79,12 +77,29 @@ const ServiceLog = () => {
title: '返回状态', title: '返回状态',
dataIndex: 'Result', dataIndex: 'Result',
key: 'Result', key: 'Result',
// render: record => { render: record => {
// if (record === 0) { let value = '';
// return '正常'; switch (record.toString().charAt(0)) {
// } case '1':
// return '错误'; value = '继续请求';
// }, break;
case '2':
value = '请求成功';
break;
case '3':
value = '重定向';
break;
case '4':
value = '客户端错误';
break;
case '5':
value = '服务器错误';
break;
default:
break;
}
return value;
},
}, },
{ {
title: '错误信息', title: '错误信息',
...@@ -102,16 +117,6 @@ const ServiceLog = () => { ...@@ -102,16 +117,6 @@ const ServiceLog = () => {
dataIndex: 'Method', dataIndex: 'Method',
key: 'Method', key: 'Method',
}, },
// {
// title: '查询参数',
// dataIndex: 'QueryString',
// key: 'QueryString',
// },
// {
// title: '请求体',
// dataIndex: 'Body',
// key: 'Body',
// },
{ {
title: '耗时/ms', title: '耗时/ms',
dataIndex: 'ConsumerTime', dataIndex: 'ConsumerTime',
...@@ -257,7 +262,7 @@ const ServiceLog = () => { ...@@ -257,7 +262,7 @@ const ServiceLog = () => {
<Button onClick={() => setTime(24 * 60, '3')}>1</Button> <Button onClick={() => setTime(24 * 60, '3')}>1</Button>
<Button onClick={() => setTime(24 * 7 * 60, '4')}>1</Button> <Button onClick={() => setTime(24 * 7 * 60, '4')}>1</Button>
<span style={{ marginLeft: '20px' }}>返回状态:</span> <span style={{ marginLeft: '20px' }}>返回状态:</span>
<Select defaultValue="常" onChange={changeStatus}> <Select defaultValue="常" onChange={changeStatus}>
<Option value="9999">全部</Option> <Option value="9999">全部</Option>
<Option value="0">正常</Option> <Option value="0">正常</Option>
<Option value="-1">错误</Option> <Option value="-1">错误</Option>
...@@ -309,7 +314,7 @@ const ServiceLog = () => { ...@@ -309,7 +314,7 @@ const ServiceLog = () => {
<Axis name="StartTime" label="" title={{ offset: 20 }} /> <Axis name="StartTime" label="" title={{ offset: 20 }} />
<Axis name="Count" title /> <Axis name="Count" title />
<Line shape="smooth" position="StartTime*Count" /> <Line shape="smooth" position="StartTime*Count" />
<Tooltip shared /> <Tooltip shared lock />
</Chart> </Chart>
</Col> </Col>
<Col span={7} offset={1}> <Col span={7} offset={1}>
...@@ -328,7 +333,7 @@ const ServiceLog = () => { ...@@ -328,7 +333,7 @@ const ServiceLog = () => {
<Axis name="Path" label="" title={{ offset: 20 }} /> <Axis name="Path" label="" title={{ offset: 20 }} />
<Axis name="Count" title /> <Axis name="Count" title />
<Interval position="Path*Count" /> <Interval position="Path*Count" />
<Tooltip shared /> <Tooltip shared lock />
</Chart> </Chart>
</Col> </Col>
<Col span={7} offset={1}> <Col span={7} offset={1}>
...@@ -347,7 +352,7 @@ const ServiceLog = () => { ...@@ -347,7 +352,7 @@ const ServiceLog = () => {
<Axis name="Path" label="" title={{ offset: 20 }} /> <Axis name="Path" label="" title={{ offset: 20 }} />
<Axis name="AvgTime" title /> <Axis name="AvgTime" title />
<Interval position="Path*AvgTime" /> <Interval position="Path*AvgTime" />
<Tooltip shared /> <Tooltip shared lock />
</Chart> </Chart>
</Col> </Col>
</Row> </Row>
......
...@@ -38,7 +38,7 @@ const Login = props => { ...@@ -38,7 +38,7 @@ const Login = props => {
console.log(values); // eg:{userName: "123", password: "123"} console.log(values); // eg:{userName: "123", password: "123"}
const { userName: loginName, password } = values; const { userName: loginName, password } = values;
setLoading(true); setLoading(true);
OMSLogin(loginName, password, 'CivManager') OMSLogin(loginName, password, 'CivManage')
.then(result => { .then(result => {
const { const {
data: { pass, userMode, token }, data: { pass, userMode, token },
......
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