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

添加宿主管理网关配置

parent 96afec15
Pipeline #38819 skipped with stages
import React, { useEffect, useState } from 'react'
import { Card, Form, Switch, message, Divider, Row, Col, Spin } from 'antd'
import styles from './gateWay.less'
import { GetGateWay, UpdateGeteWay } from '@/services/platform/hostmanager'
import configuration from '../../../../assets/images/icons/消息.svg'
const GateConfig = () => {
const [loading, setLoading] = useState(false); // 加载
const [form] = Form.useForm();
const [flag, setFlag] = useState(1)
const [currentConfig, setCurrentConfig] = useState()
const OperateNginx = (checked) => {
console.log(checked)
UpdateGeteWay({isUsed: checked}).then(res=>{
if(res.code === 0){
setFlag(flag + 1)
message.success("设置成功")
}
})
}
useEffect(() => {
GetGateWay().then(res=>{
if(res.code === 0){
setCurrentConfig(res.data)
console.log(res.data)
console.log(currentConfig)
}
})
}, [flag])
return (
<div className={styles.gateWay_container}>
<Card style={{ width: '100%', height: 'calc(100vh - 130px)' }}>
<Spin spinning={loading} tip="loading">
<div style={{ display: 'flex', alignItems: 'center', marginTop: '40px' }}>
<img src={configuration} style={{ height: '16px' }} /><span style={{ marginLeft: '10px', fontWeight: 'bold' }}>服务管理</span>
</div>
<Divider />
<div className={styles.operate_container}>
<Row gutter={[20, 25]} style={{display:'flex', alignItems:'center'}}>
<Col span={2}>
<div style={{display:'flex', justifyContent:'flex-end', marginRight:'-10px'}}>服务运行</div>
</Col>
<Col span={22}>
{console.log(currentConfig)}
<Switch checkedChildren='开启' unCheckedChildren='关闭' checked={currentConfig} onChange={OperateNginx} style={{marginLeft:'30px'}}/>
</Col>
</Row>
</div>
</Spin>
</Card>
</div>
)
}
export default GateConfig;
\ No newline at end of file
.getWay_container{
display: flex;
height: 100%;
width: 100%;
flex-direction: row;
justify-content: flex-start;
.operate_container{
display: flex;
flex-direction: column;
justify-content: space-around;
width: 100%;
height: 100%;
.operate_item{
display: flex;
flex-direction: row;
justify-content:flex-start;
align-items: center;
height: 50px;
margin-left:25px;
}
}
}
.anticon svg {
margin-top:-5px;
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ import BaseConfig from './baseConfig/BaseConfig'
import IotConfig from './IotConfig/IotConfig'
import MessageConfig from './messageConfig/messageConfig'
import ProxyConfig from './proxyConfig/ProxyConfig'
import GateConfig from './gateWay/gateWay'
const { TabPane } = Tabs;
......@@ -30,6 +30,9 @@ const HostManager = () => {
<TabPane tab="代理配置" key="4">
<ProxyConfig/>
</TabPane>
<TabPane tab="网关配置" key="5">
<GateConfig/>
</TabPane>
</Tabs>
</PageContainer>
)
......
......@@ -77,22 +77,6 @@ const EditModal = props => {
)
}, [])
useEffect(() => {
let ab=[]
GetMessageTemplate().then(
res => {
console.log(2121212)
if (res.code === 0) {
res.data.map((item, index) => {
if (item.Type === "企业微信") {
console.log(index)
ab.push(item)
}
})
}
}
)
console.log(ab)
console.log()
console.log('template', template);
console.log(template.WorkWeiXinTemplateId)
let aa
......
......@@ -38,6 +38,11 @@ export const NginxCache = param =>
get(`${PUBLISH_SERVICE}/HostManager/NginxCache`, param);
export const ReloadNginx = param =>
get(`${PUBLISH_SERVICE}/HostManager/ReloadNginx`, param);
//获取网关配置
export const GetGateWay = param =>
get(`${PUBLISH_SERVICE}/HostManager/GetGateWay`, param);
export const UpdateGeteWay = param =>
get(`${PUBLISH_SERVICE}/HostManager/UpdateGeteWay`, param);
//代理服务老接口
export const GetNginxConfigInfoOLD = param =>
......
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