Commit a460cb17 authored by 皮倩雯's avatar 皮倩雯

fix: '宿主管理中台配置跳转开启网关'

parent de445182
Pipeline #67151 canceled with stages
/* eslint-disable global-require */ /* eslint-disable global-require */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Form, Divider, Button, Input, message } from 'antd'; import { Form, Divider, Button, Input, message, Modal, Space } from 'antd';
import { SaveETLConfig, GetETLConfig } from '@/services/hostmanager/hostmanager'; import { InfoCircleFilled } from '@ant-design/icons';
import { SaveETLConfig, GetETLConfig, GetGateWay } from '@/services/hostmanager/hostmanager';
import styles from './index.less'; import styles from './index.less';
const ETCConfig = () => { const ETCConfig = props => {
const { setActiveKey } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const [getWayVisible, setGetWayVisible] = useState(false);
useEffect(() => { useEffect(() => {
GetGateWay().then(res => {
if (res.code === 0) {
if (res.data === false) {
setGetWayVisible(true);
}
}
});
GetETLConfig().then(res => { GetETLConfig().then(res => {
if (res.code === 0) { if (res.code === 0) {
console.log(res.data, 'res.data'); console.log(res.data, 'res.data');
...@@ -99,6 +109,34 @@ const ETCConfig = () => { ...@@ -99,6 +109,34 @@ const ETCConfig = () => {
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
<Modal
visible={getWayVisible}
title="提示"
width="350px"
closable={false}
footer={
<Space>
<Button
onClick={() => {
setGetWayVisible(false);
setActiveKey('5');
}}
type="primary"
>
好的,去开启
</Button>
</Space>
}
>
<InfoCircleFilled
style={{
color: '#faad14',
fontSize: '18px',
marginRight: '10px',
}}
/>
<span>当前网关暂未打开,请前往开启!</span>
</Modal>
</div> </div>
); );
}; };
......
...@@ -33,7 +33,7 @@ const HostManager = () => { ...@@ -33,7 +33,7 @@ const HostManager = () => {
<ProxyConfig /> <ProxyConfig />
</TabPane> */} </TabPane> */}
<TabPane tab="中台配置" key="6"> <TabPane tab="中台配置" key="6">
<ETLConfig /> <ETLConfig setActiveKey={setActiveKey} />
</TabPane> </TabPane>
<TabPane tab="网关配置" key="5"> <TabPane tab="网关配置" key="5">
<GateConfig /> <GateConfig />
......
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