Skip to content

Commit

Permalink
🚀 新增网络分析能力,支持网络拨测和定时拨测任务 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cairry authored Nov 23, 2024
1 parent a96b327 commit c1dd9a4
Show file tree
Hide file tree
Showing 12 changed files with 1,778 additions and 597 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"prom-client": "^15.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-fast-marquee": "^1.6.5",
"react-helmet": "^6.1.0",
"react-json-editor-ajrm": "^2.5.14",
"react-json-view": "^1.21.3",
Expand Down
87 changes: 0 additions & 87 deletions src/api/monitor.jsx

This file was deleted.

105 changes: 105 additions & 0 deletions src/api/probing.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import http from '../utils/http';
import { message } from 'antd';

async function ProbingList(params) {
try {
const res = await http('get', '/api/w8t/probing/listProbing', params);
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测列表获取失败',
});
return error
}
}

async function ProbingSearch(params) {
try {
const res = await http('get', '/api/w8t/probing/searchProbing', params);
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测规则信息获取失败',
});
return error
}
}

async function ProbingCreate(params) {
try {
const res = await http('post', '/api/w8t/probing/createProbing', params);
message.open({
type: 'success',
content: '拨测规则创建成功',
});
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测规则创建失败',
});
return error
}
}

async function ProbingUpdate(params) {
try {
const res = await http('post', '/api/w8t/probing/updateProbing', params);
message.open({
type: 'success',
content: '拨测规则更新成功',
});
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测规则更新失败',
});
return error
}
}

async function ProbingDelete(params) {
try {
const res = await http('post', '/api/w8t/probing/deleteProbing', params);
message.open({
type: 'success',
content: '拨测规则删除成功',
});
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测规则删除失败',
});
return error
}
}

async function ProbingOnce(params) {
try {
const res = await http('post', '/api/w8t/probing/onceProbing', params);
message.open({
type: 'success',
content: '拨测请求提交成功!',
});
return res;
} catch (error) {
message.open({
type: 'error',
content: '拨测请求提交失败!',
});
return error
}
}

export {
ProbingList,
ProbingSearch,
ProbingCreate,
ProbingUpdate,
ProbingDelete,
ProbingOnce
}
30 changes: 11 additions & 19 deletions src/components/sider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
FileDoneOutlined,
SettingOutlined,
SafetyCertificateOutlined,
BookOutlined
ApiOutlined
// CloudSyncOutlined,
// SafetyOutlined
} from '@ant-design/icons';
Expand Down Expand Up @@ -59,27 +59,20 @@ export const ComponentSider = (props) => {
<Menu.Item key='3-2' onClick={(e) => handleMenuClick(e.key, '/noticeTemplate')}>通知模版</Menu.Item>
<Menu.Item key='3-3' onClick={(e) => handleMenuClick(e.key, '/noticeRecords')}>通知记录</Menu.Item>
</SubMenu>

<SubMenu key='4' icon={<CalendarOutlined />} title='值班管理'>
<Menu.Item key='4-1' onClick={(e) => handleMenuClick(e.key, '/dutyManage')}>值班日程</Menu.Item>
</SubMenu>

<SubMenu key='11' icon={<ApiOutlined />} title='网络分析'>
<Menu.Item key='11-1' onClick={(e) => handleMenuClick(e.key, '/probing')}>拨测任务</Menu.Item>
<Menu.Item key='11-2' onClick={(e) => handleMenuClick(e.key, '/onceProbing')}>及时拨测</Menu.Item>
</SubMenu>
<Menu.Item key='6' onClick={(e) => handleMenuClick(e.key, '/datasource')} icon={<PieChartOutlined />}>数据源</Menu.Item>
<Menu.Item key='8' onClick={(e) => handleMenuClick(e.key, '/folders')} icon={<DashboardOutlined />}>仪表盘</Menu.Item >
<SubMenu key='5' icon={<UserOutlined />} title='人员组织'>
<Menu.Item key='5-1' onClick={(e) => handleMenuClick(e.key, '/user')}>用户管理</Menu.Item>
<Menu.Item key='5-2' onClick={(e) => handleMenuClick(e.key, '/userRole')}>角色管理</Menu.Item>
</SubMenu>
<Menu.Item key='7' onClick={(e) => handleMenuClick(e.key, '/tenants')} icon={<DeploymentUnitOutlined />}>租户管理</Menu.Item>
<Menu.Item key='6' onClick={(e) => handleMenuClick(e.key, '/datasource')} icon={<PieChartOutlined />}>数据源</Menu.Item>
<Menu.Item key='8' onClick={(e) => handleMenuClick(e.key, '/folders')} icon={<DashboardOutlined />}>仪表盘</Menu.Item >
{/*<SubMenu key='10' icon={<CloudSyncOutlined />} title='云拨测'>*/}
{/* <Menu.Item key='10-1' onClick={(e) => handleMenuClick(e.key, '/userRole')}>即时拨测</Menu.Item>*/}
{/* <Menu.Item key='10-2' onClick={(e) => handleMenuClick(e.key, '/user')}>拨测中心</Menu.Item>*/}
{/*</SubMenu>*/}
{/*<SubMenu key='11' icon={<SafetyOutlined />} title='智能洞察'>*/}
{/* <Menu.Item key='11-1' onClick={(e) => handleMenuClick(e.key, '/user')}>事件大盘</Menu.Item>*/}
{/* <Menu.Item key='11-2' onClick={(e) => handleMenuClick(e.key, '/userRole')}>事件中心</Menu.Item>*/}
{/*</SubMenu>*/}
<Menu.Item key='11' onClick={(e) => handleMenuClick(e.key, '/monitor/ssl/list')} icon={<SafetyCertificateOutlined />}>证书监控</Menu.Item >
<Menu.Item key='9' onClick={(e) => handleMenuClick(e.key, '/auditLog')} icon={<FileDoneOutlined />}>日志审计</Menu.Item >
<Menu.Item key='10' onClick={(e) => handleMenuClick(e.key, '/settings')} icon={<SettingOutlined />}>系统设置</Menu.Item >
</Menu>
Expand All @@ -99,8 +92,6 @@ export const ComponentSider = (props) => {
<Menu.Item key='2-1' onClick={(e) => handleMenuClick(e.key, '/ruleGroup')}>告警规则</Menu.Item>
<Menu.Item key='2-2' onClick={(e) => handleMenuClick(e.key, '/silenceRules')}>静默规则</Menu.Item>
<Menu.Item key='2-3' onClick={(e) => handleMenuClick(e.key, '/events')}>告警事件</Menu.Item>
{/*<Menu.Item key='2-3' onClick={(e) => handleMenuClick(e.key, '/alertCurEvent')}>当前告警</Menu.Item>*/}
{/*<Menu.Item key='2-4' onClick={(e) => handleMenuClick(e.key, '/alertHisEvent')}>历史告警</Menu.Item>*/}
<Menu.Item key='2-5' onClick={(e) => handleMenuClick(e.key, '/ruleTemplateGroup')}>规则模版</Menu.Item>
<Menu.Item key='2-6' onClick={(e) => handleMenuClick(e.key, '/subscribes')}>告警订阅</Menu.Item>
</SubMenu>
Expand All @@ -114,10 +105,11 @@ export const ComponentSider = (props) => {
<SubMenu key='4' icon={<CalendarOutlined />} title='值班管理'>
<Menu.Item key='4-1' onClick={(e) => handleMenuClick(e.key, '/dutyManage')}>值班日程</Menu.Item>
</SubMenu>

<Menu.Item key='6' onClick={(e) => handleMenuClick(e.key, '/datasource')} icon={<PieChartOutlined />}>数据源</Menu.Item>
<SubMenu key='11' icon={<ApiOutlined />} title='网络分析'>
<Menu.Item key='11-1' onClick={(e) => handleMenuClick(e.key, '/probing')}>拨测任务</Menu.Item>
<Menu.Item key='11-2' onClick={(e) => handleMenuClick(e.key, '/onceProbing')}>及时拨测</Menu.Item>
</SubMenu> <Menu.Item key='6' onClick={(e) => handleMenuClick(e.key, '/datasource')} icon={<PieChartOutlined />}>数据源</Menu.Item>
<Menu.Item key='8' onClick={(e) => handleMenuClick(e.key, '/folders')} icon={<DashboardOutlined />}>仪表盘</Menu.Item >
<Menu.Item key='11' onClick={(e) => handleMenuClick(e.key, '/monitor/ssl/list')} icon={<SafetyCertificateOutlined />}>证书监控</Menu.Item >
</Menu>
</>
);
Expand Down
19 changes: 18 additions & 1 deletion src/pages/alert/rule/create.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import { List, Form, Input, Button, Switch, Radio, Divider, Select, Tooltip, InputNumber, Card,TimePicker } from 'antd'
import {
List,
Form,
Input,
Button,
Switch,
Radio,
Divider,
Select,
Tooltip,
InputNumber,
Card,
TimePicker,
Typography
} from 'antd'
import React, { useState, useEffect, useRef } from 'react'
import { QuestionCircleOutlined } from '@ant-design/icons'
import {createRule, searchRuleInfo, updateRule} from '../../../api/rule'
Expand Down Expand Up @@ -1679,6 +1693,9 @@ export const AlertRule = ({ type, ruleGroupId }) => {
value={secondsToDateObj(endTime)}
/>
</div>
<Typography.Text type="secondary" style={{ marginTop: '5px', fontSize: '12px' }}>
{"> 默认情况下规则随时生效。如需指定生效时间,请选择具体的时间。"}
</Typography.Text>
</MyFormItem>

</div>
Expand Down
Loading

0 comments on commit c1dd9a4

Please sign in to comment.