Commit 55e0f46b authored by mayongxin's avatar mayongxin

fix:宿主管理

parent 67130ce9
Pipeline #24249 passed with stages
in 17 minutes 44 seconds
import React, { useEffect, useState } from 'react'
import { Card, Form, Input, Button, Select } from 'antd'
import styles from './IotConfig.less'
const layout = {
labelCol: { span: 8 },
wrapperCol: { span: 16 },
};
const tailLayout = {
wrapperCol: { offset: 8, span: 16 },
};
const IotConfig = () => {
const onFinish = (values) => {
console.log('Success:', values);
};
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
return (
<div className={styles.iot_container}>
<Card title="物联平台(V2.1.0302)" style={{ width: 350 }}>
<Form
{...layout}
name="basic"
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
>
<Form.Item
label="服务器地址"
name="username"
rules={[{ required: true, message: '请输入服务器地址!' }]}
>
<Input />
</Form.Item>
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存连接
</Button>
</Form.Item>
</Form>
</Card>
<Card title="EMQ服务器" style={{ width: 350, marginLeft: 15 }}>
<Form
{...layout}
name="basic"
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
>
<Form.Item
name="select"
label="SSL"
hasFeedback
rules={[{ required: true, message: 'Please select your country!' }]}
initialValue="否"
>
<Select placeholder="Please select a country">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</Form.Item>
<Form.Item
label="服务器地址"
name="username"
rules={[{ required: true, message: '请输入服务器地址!' }]}
>
<Input />
</Form.Item>
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
保存连接
</Button>
</Form.Item>
</Form>
</Card>
</div>
)
}
export default IotConfig
\ No newline at end of file
.iot_container{
display: flex;
height: 100%;
width: 100%;
flex-direction: row;
justify-content: flex-start;
}
\ No newline at end of file
import React, { useState, useEffect } from 'react'
import { Card } from 'antd'
import styles from './BaseConfig.less'
import { S_GetDataBaseConfig, GetTCPConfigInfo } from '../../../../services/platform/hostmanager'
const BaseConfig = () => {
const [currentDataBase, setCurrentDataBase] = useState({});
const [currentSiteInfo, setcurrentSiteInfo] = useState({getMe:[{SiteCode:""}]});
useEffect(() => {
getCurrentConfig()
getSiteCode()
},[])
const getCurrentConfig = () => {
S_GetDataBaseConfig({
_version: 9999,
_dc: new Date().getTime(),
}).then(
res => {
if (res.success === true) {
setCurrentDataBase(res)
}
}
)
}
const getSiteCode = () => {
GetTCPConfigInfo({
_version: 9999,
_dc: new Date().getTime(),
}).then(
res => {
if (res.say.statusCode === '0000') {
setcurrentSiteInfo(res)
}
}
)
}
return (
<div className={styles.base_container}>
<Card title="数据库连接" style={{ width: 300 }}>
<Card type="inner" title="服务器IP" style={{ margin: 10 }}>
{currentDataBase.ip}
</Card>
<Card type="inner" title="数据库名称" style={{ margin: 10 }}>
{currentDataBase.dbName}
</Card>
</Card>
<Card title="权限验证" style={{ width: 300, marginLeft: 15 }}>
<Card type="inner" title="登录名" style={{ margin: 10 }}>
{currentDataBase.userName}
</Card>
<Card type="inner" title="密码" style={{ margin: 10 }}>
{currentDataBase.password}
</Card>
</Card>
<Card title="站点信息" style={{ width: 300, marginLeft: 15 }}>
<Card type="inner" title="站点编号" style={{ margin: 10 }}>
{currentSiteInfo.getMe[0].SiteCode}
</Card>
</Card>
</div>
)
}
export default BaseConfig
.base_container{
display: flex;
height: 100%;
width: 100%;
flex-direction: row;
justify-content: flex-start;
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Tabs } from 'antd';
import PageContainer from '@/components/BasePageContainer';
import BaseConfig from './baseConfig/BaseConfig'
import IotConfig from './IotConfig/IotConfig'
const { TabPane } = Tabs;
const HostManager = () => {
const callback = () => {
}
return (
<PageContainer>
<Tabs onChange={callback} type="card">
<TabPane tab="基础配置" key="1">
<BaseConfig/>
</TabPane>
<TabPane tab="物联配置" key="2">
<IotConfig/>
</TabPane>
<TabPane tab="消息配置" key="3">
Content of Tab Pane 3
</TabPane>
<TabPane tab="代理配置" key="4">
Content of Tab Pane 3
</TabPane>
</Tabs>
</PageContainer>
)
}
export default HostManager;
\ No newline at end of file
......@@ -35,6 +35,7 @@ import ProductConfig from '@/pages/webConfig/productConfig';
import { USER_MODE } from '@/utils/constants';
import BaseFrameContainer from '@/components/BaseFrameContainer';
import JumpContainer from '@/components/JumpContainer';
import HostManager from '@/pages/platformCenter/hostmanager'
// import ColConen from '@/components/Colophon/colContent';
const iconStyle = { verticalAlign: '0.125em' };
......@@ -205,7 +206,7 @@ export default {
name: '宿主管理',
url:
'/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true',
component: BaseFrameContainer,
component: HostManager,
},
],
},
......
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
export const S_GetDataBaseConfig = param =>
get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseConfig`, param);
export const GetTCPConfigInfo = param =>
get(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/GetTCPConfigInfo`, param);
\ No newline at end of file
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