diff --git a/config/routes/index.ts b/config/routes/index.ts index 31b490e..6368bb9 100644 --- a/config/routes/index.ts +++ b/config/routes/index.ts @@ -34,7 +34,7 @@ const routes = [ // ------------------------------网络GLQ配置---------------------------------- // 获取配置信息 { path: '/webGLQ/serviceListInfo', name: '服务列表信息', component: '@/pages/GLQ/WebGLQ/ServiceListInfo' }, - { path: '/webGLQ/networkConfignInfo', name: '网络配置信息', component: '@/pages/GLQ/WebGLQ/NetworkConfignInfo' }, + { path: '/webGLQ/networkConfigInfo', name: '网络配置信息', component: '@/pages/GLQ/WebGLQ/NetworkConfigInfo' }, { path: '/webGLQ/securityPolicyInfo', name: '安全策略信息', component: '@/pages/GLQ/WebGLQ/SecurityPolicyInfo' }, { path: '/webGLQ/manageConfigInfo', name: '管理配置信息', component: '@/pages/GLQ/WebGLQ/ManageConfigInfo' }, { path: '/webGLQ/vpnPolicyInfo', name: 'VPN策略信息', component: '@/pages/GLQ/WebGLQ/VpnPolicyInfo' }, diff --git a/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx b/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx index 35f6b0f..08c71a6 100644 --- a/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx +++ b/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx @@ -3,18 +3,11 @@ import styles from '../../index.less'; import { Form, Input, message } from 'antd'; import ButtonComp from '@/components/ButtonComp'; import { setParameter } from '@/services/gql'; +import { validateIPAddress } from '@/utils/validate'; export default function Page() { const [form] = Form.useForm(); - // ip校验 - const validateIPAddress = (_: any, value: any) => { - if (value && !/^(\d{1,3}\.){3}\d{1,3}$/.test(value)) { - return Promise.reject(new Error('请输入正确的 IP 地址')); - } - return Promise.resolve(); - }; - const onFinish = (values: any) => { setParameter({ ipAddress: values.ipAddress diff --git a/src/pages/GLQ/WebGLQ/LogRecordInfo/index.tsx b/src/pages/GLQ/WebGLQ/LogRecordInfo/index.tsx index 2b4d6a4..f81021d 100644 --- a/src/pages/GLQ/WebGLQ/LogRecordInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/LogRecordInfo/index.tsx @@ -1,11 +1,51 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> 日志记录信息 +// 网络GQL管理 --> 获取日志信息 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 4}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取日志信息`, + `正在获取日志信息中...`, + `获取日志信息完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
@@ -13,16 +53,32 @@ export default function Page() {
被控端隔离器错误日志信息
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); } \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/ManageConfigInfo/index.tsx b/src/pages/GLQ/WebGLQ/ManageConfigInfo/index.tsx index 8b1294d..53c552a 100644 --- a/src/pages/GLQ/WebGLQ/ManageConfigInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/ManageConfigInfo/index.tsx @@ -1,11 +1,51 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> 管理配置信息 +// 网络GQL管理 --> 获取管理配置 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 4}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取管理配置`, + `正在获取管理配置中...`, + `获取管理配置完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
@@ -13,16 +53,32 @@ export default function Page() {
被控端服务管理配置情况
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); -} +} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/NetworkConfigInfo/index.tsx b/src/pages/GLQ/WebGLQ/NetworkConfigInfo/index.tsx new file mode 100644 index 0000000..86342dc --- /dev/null +++ b/src/pages/GLQ/WebGLQ/NetworkConfigInfo/index.tsx @@ -0,0 +1,84 @@ +import ContentWarp from '@/components/ContentWarp'; +import styles from '../../index.less'; +import ButtonComp from '@/components/ButtonComp'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; + +// 网络GQL管理 --> 获取网络配置 +export default function Page() { + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 2}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取网络配置`, + `正在获取网络配置中...`, + `获取网络配置完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } + + return ( +
+ +
被控端网络状态信息配置情况
+
+
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
+
+
+ { statusQuery() }} /> + + setVisibility(true)} /> +
+
+
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
+
+ ); +} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/NetworkConfignInfo/index.tsx b/src/pages/GLQ/WebGLQ/NetworkConfignInfo/index.tsx deleted file mode 100644 index f4c6e58..0000000 --- a/src/pages/GLQ/WebGLQ/NetworkConfignInfo/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import ContentWarp from '@/components/ContentWarp'; -import styles from '../../index.less'; -import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; - -// 网络GLQ配置 --> 获取配置信息--> 网络配置信息 -export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') - - return ( -
- -
被控端网络状态信息配置情况
-
-
-
-
-
-
- { }} /> - { }} /> - setHtmlText('')} /> -
-
-
-
- ); -} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/SecurityPolicyInfo/index.tsx b/src/pages/GLQ/WebGLQ/SecurityPolicyInfo/index.tsx index 48ece2a..bba9166 100644 --- a/src/pages/GLQ/WebGLQ/SecurityPolicyInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/SecurityPolicyInfo/index.tsx @@ -1,30 +1,84 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> 获取安全策略 +// 网络GQL管理 --> 获取安全策略 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 3}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取安全策略`, + `正在获取安全策略中...`, + `获取安全策略完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
- +
被控端报文过滤策略配置情况
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); -} - - +} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/ServiceList/index.tsx b/src/pages/GLQ/WebGLQ/ServiceList/index.tsx index 5e4935c..019f79a 100644 --- a/src/pages/GLQ/WebGLQ/ServiceList/index.tsx +++ b/src/pages/GLQ/WebGLQ/ServiceList/index.tsx @@ -1,19 +1,22 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; -import { ConfigProvider, Form, Input, Table } from 'antd'; +import { ConfigProvider, Form, Input, Table, message } from 'antd'; import ButtonComp from '@/components/ButtonComp'; import { useState } from 'react'; import { rowClassName } from '@/utils'; +import { validateIPAddress, validatePort } from '@/utils/validate'; +import { remoteFileConfiSendData, remoteFileConfigClean } from '@/services/gql'; // 网络GLQ配置 --> 远程文件配置--> 服务列表 export default function Page() { const [form] = Form.useForm(); - const [tableData, setTableData] = useState([]); + const [tableData, setTableData] = useState([]); const onFinish = (values: any) => { - console.log('表单提交:', values); + values.rowKey = Math.random(); + setTableData([...tableData, values]) }; const columns: any = [ @@ -23,10 +26,41 @@ export default function Page() { return {c + 1}; }, }, - { title: '服务名称', dataIndex: 'name', key: 'name', align: 'center' }, - { title: '服务器IP', dataIndex: 'name', key: 'name', align: 'center' }, - { title: '服务端口', dataIndex: 'name', key: 'name', align: 'center' }, + { title: '服务名称', dataIndex: 'serviceName', key: 'serviceName', align: 'center' }, + { title: '服务器IP', dataIndex: 'serviceIP', key: 'serviceIP', align: 'center' }, + { title: '服务端口', dataIndex: 'servicePort', key: 'servicePort', align: 'center' }, ] + + const sending = () => { + if(tableData.length == 0) { + message.info('请添加数据'); + return + } + + let serviceList = tableData.map(({serviceName, serviceIP, servicePort}: any) => { + return {serviceName, serviceIP, servicePort} + }) + remoteFileConfiSendData({ + jsonStr: JSON.stringify({ serviceList: serviceList }), + type: 1 + }).then( (res) => { + if (res?.result == "success") { + message.success('发送数据成功'); + }else { + message.error(res?.errorMsg); + } + }) + } + + const clearInfo = () => { + remoteFileConfigClean({type: 1}).then(res => { + if (res?.result == "success") { + message.success('清除信息成功'); + }else { + message.error(res?.errorMsg); + } + }) + } return (
@@ -36,16 +70,16 @@ export default function Page() {
- - + + - - + + -
- { }} /> - form.submit()} /> -
+ + + + form.submit()} /> record?.id} + rowKey={(record: any) => record?.rowKey} rowClassName={rowClassName} />
- { }} /> - { }} /> + sending()} /> + clearInfo()} />
diff --git a/src/pages/GLQ/WebGLQ/ServiceListInfo/index.tsx b/src/pages/GLQ/WebGLQ/ServiceListInfo/index.tsx index fde2edd..fe65d6e 100644 --- a/src/pages/GLQ/WebGLQ/ServiceListInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/ServiceListInfo/index.tsx @@ -1,11 +1,51 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> 服务列表信息 +// 网络GQL管理 --> 获取服务列表 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 1}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取服务列表`, + `正在获取服务列表中...`, + `获取服务列表完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
@@ -13,17 +53,32 @@ export default function Page() {
获取被控端服务列表情况
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); -} - +} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/VpnPolicyInfo/index.tsx b/src/pages/GLQ/WebGLQ/VpnPolicyInfo/index.tsx index 405f531..d369af3 100644 --- a/src/pages/GLQ/WebGLQ/VpnPolicyInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/VpnPolicyInfo/index.tsx @@ -1,11 +1,51 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> VPN策略信息 +// 网络GQL管理 --> 获取VPN策略 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 4}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取VPN策略`, + `正在获取VPN策略中...`, + `获取VPN策略完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
@@ -13,16 +53,32 @@ export default function Page() {
被控端VPN过滤策略配置情况
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); -} +} \ No newline at end of file diff --git a/src/pages/GLQ/WebGLQ/firewallPolicyInfo/index.tsx b/src/pages/GLQ/WebGLQ/firewallPolicyInfo/index.tsx index d5a223e..a136b83 100644 --- a/src/pages/GLQ/WebGLQ/firewallPolicyInfo/index.tsx +++ b/src/pages/GLQ/WebGLQ/firewallPolicyInfo/index.tsx @@ -1,11 +1,51 @@ import ContentWarp from '@/components/ContentWarp'; import styles from '../../index.less'; import ButtonComp from '@/components/ButtonComp'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import { getGlqInfo } from '@/services/gql'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; +import SaveAs from '@/components/SaveAs'; -// 网络GLQ配置 --> 获取配置信息--> 防火墙策略信息 +// 网络GQL管理 --> 获取防火墙策略 export default function Page() { - const [htmlText, setHtmlText] = useState('
文本内容
') + const [lines, setLines] = useState([]); + const [currentLineIndex, setCurrentLineIndex] = useState(0); + const [visibility, setVisibility] = useState(false); + const outputRef: any = useRef(null); + + useEffect(() => { + const timer = setInterval(() => { + if (currentLineIndex < lines.length) { + setCurrentLineIndex((prevIndex) => prevIndex + 1); + } else { + clearInterval(timer); + } + }, 300); + + if (outputRef.current.scrollHeight > 330) { + outputRef.current.scrollTop = outputRef.current.scrollHeight; + } + + return () => { + clearInterval(timer); // 组件卸载时清除定时器 + }; + }, [currentLineIndex, lines.length]); + + const statusQuery = () => { + getGlqInfo({type: 4}).then((res) => { + if (res?.result == "success") { + setLines([ + ...lines, + '发送命令成功', + `获取防火墙策略`, + `正在获取防火墙策略中...`, + `获取防火墙策略完成` + ]) + } else { + setLines([`${res?.errorMsg}`]) + } + }) + } return (
@@ -13,16 +53,32 @@ export default function Page() {
被控端防火墙策略配置情况
-
-
+
+
+ {lines.slice(0, currentLineIndex).map((line: string, index: number) => ( +

{line}

+ ))} +
- { }} /> - { }} /> - setHtmlText('')} /> + { statusQuery() }} /> + + setVisibility(true)} />
+ + setVisibility(false)} + onOk={() => { + if (lines.length == 0) return; + setLines([]); + setCurrentLineIndex(0); + setVisibility(false); + }}> +
确定清空信息吗?
+
); } \ No newline at end of file diff --git a/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx b/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx index eda6ec0..8781926 100644 --- a/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx +++ b/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx @@ -21,6 +21,7 @@ export default function Page() { let layoutInfo: any = localStorage.getItem('MMJInit'); if (layoutInfo) { form.setFieldsValue({...JSON.parse(layoutInfo)}) + setDataLoading(true); } }, []) @@ -49,7 +50,7 @@ export default function Page() { if (res?.result == "success") { message.success('发送数据成功'); } else { - message.error('发送数据失败'); + message.error(res?.errorMsg); } }) } @@ -61,7 +62,7 @@ export default function Page() { form.resetFields() localStorage.removeItem('MMJInit'); } else { - message.error('清空信息失败'); + message.error(res?.errorMsg); } }) } diff --git a/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx b/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx index bbe04df..7393897 100644 --- a/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx +++ b/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx @@ -70,7 +70,7 @@ export default function Page() {
{ statusQuery() }} /> - + setVisibility(true)} />
diff --git a/src/pages/InitialSystem/DeviceInstall/index.tsx b/src/pages/InitialSystem/DeviceInstall/index.tsx index a3e5be6..92fbbbd 100644 --- a/src/pages/InitialSystem/DeviceInstall/index.tsx +++ b/src/pages/InitialSystem/DeviceInstall/index.tsx @@ -27,6 +27,7 @@ const DeviceInstall: FC = ({ }) => { let layoutInfo: any = localStorage.getItem('deviceInit'); if (layoutInfo) { setFileInfo(JSON.parse(layoutInfo)) + setDataLoading(true); } }, []) @@ -79,7 +80,7 @@ const DeviceInstall: FC = ({ }) => { if (res?.result == "success") { message.success('数据安装成功') } else { - message.error('数据加安装失败') + message.error(res?.errorMsg); } }) }} /> diff --git a/src/services/gql.ts b/src/services/gql.ts index 35481f5..93ab63a 100644 --- a/src/services/gql.ts +++ b/src/services/gql.ts @@ -5,8 +5,7 @@ export async function setParameter(data: any) { return postRequest(`/xgd/parameterSet/setParameter`, data); } -// -----------------------------MMJ初装------------------------- -// 清空信息 +// MMJ初装--清空信息 export async function secretInit_cleanInfo(params: any) { return getRequest(`/xgd/secretInit/cleanInfo`, params); } @@ -30,4 +29,23 @@ export async function secretInit_sendCommand(params: any) { // 发送数据 export async function secretInit_sendData(params: any) { return postRequest(`/xgd/secretInit/sendData`, params); +} + +// 网络隔离器配置 +// @param type 1.服务器列表信息 2.网络配置信息 3安全策略信息 4.管理配置信息 5.VPN策略信息 6.防火墙策略信息 7.日志记录信息 +export async function getGlqInfo(params: any) { + return getRequest(`/xgd/netGlq/getGlqInfo`, params); +} + +// 远程文件配置 +// @param jsonStr +// @param type +export async function remoteFileConfiSendData(params: any) { + return getRequest(`/xgd/netGlq/remoteFileConfiSendData`, params); +} + +// 远程文件配置模块的所有--清空信息 +// @param type +export async function remoteFileConfigClean(params: any) { + return getRequest(`/xgd/netGlq/remoteFileConfigClean`, params); } \ No newline at end of file diff --git a/src/utils/index.ts b/src/utils/index.ts index 7ccd70a..0ca67a4 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,70 +1,3 @@ export const rowClassName = (record:any, index: any) => { return index % 2 === 0 ? 'even-row' : 'odd-row'; -}; - -const parseParamsStr = (v: any, method?: string) => { - const param: any = {}; - const p = Object.assign(true, v, {}); - const arr: any = []; - Object.keys(p) - .sort() - .forEach(function (key) { - p[key] = p[key] === true ? 'true' : p[key]; - p[key] = p[key] === false ? 'false' : p[key]; - if (method === 'GET') { - if (p[key] !== null) { - if (typeof p[key] === 'object') { - param[key] = p[key]; - } else { - param[key] = String(p[key]); - } - if (typeof p[key] === 'object' && p[key] == '') return; - const _key = p[key] === null || p[key] === 'null' ? '' : p[key]; - arr.push( - `${key}=${ - typeof _key === 'string' || typeof _key === 'number' ? _key : JSON.stringify(_key) - }`, - ); - } - } else { - const _key = p[key] === null || p[key] === 'null' ? '' : p[key]; - arr.push( - `${key}=${ - typeof _key === 'string' || typeof _key === 'number' ? _key : JSON.stringify(_key) - }`, - ); - if (typeof p[key] === 'object') { - param[key] = p[key]; - } else { - param[key] = p[key]; - } - } - }); - return arr.join('&'); -}; - -const aKey = 'e83900ca9be33747397cc81a8f68ac11'; -const sKey = '6de3a75ae5718cde1e0907a593afd01f'; - -export const setHeader = (newOptions: any, url?: string) => { - const timenow = Date.now(); - const stringToSign = - 'method=' + - newOptions.method + - '&' + - (!!Object.keys(newOptions?.params || {})?.length - ? parseParamsStr(newOptions.params, newOptions.method) + '&' - : '') + - (!!Object.keys(newOptions?.body || {})?.length - ? parseParamsStr(JSON.parse(newOptions.body)) + '&' - : '') + - 'ak=' + - aKey + - '&sk=' + - sKey + - '&time=' + - timenow; - - newOptions.headers['X-EDU-Timestamp'] = timenow; - return newOptions; }; \ No newline at end of file diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 9b0a499..4eb4458 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -61,7 +61,7 @@ export const MenuType: any = { check: true, data: [ { name: '服务列表信息', url: '/webGLQ/serviceListInfo', img: '' }, - { name: '网络配置信息', url: '/webGLQ/networkConfignInfo', img: '' }, + { name: '网络配置信息', url: '/webGLQ/networkConfigInfo', img: '' }, { name: '安全策略信息', url: '/webGLQ/securityPolicyInfo', img: '' }, { name: '管理配置信息', url: '/webGLQ/manageConfigInfo', img: '' }, { name: 'VPN策略信息', url: '/webGLQ/vpnPolicyInfo', img: '' }, diff --git a/src/utils/validate.ts b/src/utils/validate.ts new file mode 100644 index 0000000..160361f --- /dev/null +++ b/src/utils/validate.ts @@ -0,0 +1,16 @@ + +// 校验端口 +export const validatePort = (_: any, value: any, callback: any) => { + if (value && !/^\d+$/.test(value)) { + return Promise.reject(new Error('请输入有效的端口号')); + } + return Promise.resolve(); +}; + +// 校验ip +export const validateIPAddress = (_: any, value: any) => { + if (value && !/^(\d{1,3}\.){3}\d{1,3}$/.test(value)) { + return Promise.reject(new Error('请输入正确的 IP 地址')); + } + return Promise.resolve(); +}; \ No newline at end of file