Commit 89f2dd41 authored by mayongxin's avatar mayongxin

perf:物联配置优化

parent 56454852
Pipeline #26325 passed with stages
in 24 minutes 14 seconds
...@@ -70,7 +70,7 @@ const IotConfig = () => { ...@@ -70,7 +70,7 @@ const IotConfig = () => {
} }
) )
} }
const PingIot = (ip, values) => { const PingIot = ({ip, values}) => {
PingIOTPlatform({ PingIOTPlatform({
ip: ip ip: ip
}).then( }).then(
...@@ -100,7 +100,7 @@ const IotConfig = () => { ...@@ -100,7 +100,7 @@ const IotConfig = () => {
return ( return (
<div className={styles.iot_container}> <div className={styles.iot_container}>
<Card title={`物联平台[${currentIotVersion.data}]`} style={{ width: 430 }}> <Card title={`物联平台${currentIotVersion.data?`[${currentIotVersion.data}]`:""}`} style={{ width: 430 }}>
<Form <Form
{...layout} {...layout}
...@@ -110,6 +110,7 @@ const IotConfig = () => { ...@@ -110,6 +110,7 @@ const IotConfig = () => {
onFinish={onFinish} onFinish={onFinish}
onFinishFailed={onFinishFailed} onFinishFailed={onFinishFailed}
> >
<div className={styles.section}>物联平台</div>
<Form.Item <Form.Item
label="服务器地址(平台)" label="服务器地址(平台)"
name="IotAddress" name="IotAddress"
...@@ -118,7 +119,7 @@ const IotConfig = () => { ...@@ -118,7 +119,7 @@ const IotConfig = () => {
> >
<Input /> <Input />
</Form.Item> </Form.Item>
<div className={styles.section}>EMQ</div>
<Form.Item <Form.Item
label="服务器地址(EMQ)" label="服务器地址(EMQ)"
name="TcpAddress" name="TcpAddress"
......
...@@ -4,4 +4,10 @@ ...@@ -4,4 +4,10 @@
width: 100%; width: 100%;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
.section{
background-color: #F5F7FA;
width: 100%;
height: 20px;
margin-bottom: 10px;
}
} }
\ No newline at end of file
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { Card } from 'antd' import { Descriptions } from 'antd'
import styles from './BaseConfig.less' import styles from './BaseConfig.less'
import { S_GetDataBaseConfig, GetTCPConfigInfo,GetDataBaseConfig,GetBasicInfo } from '../../../../services/platform/hostmanager' import { S_GetDataBaseConfig, GetTCPConfigInfo, GetDataBaseConfig, GetBasicInfo } from '@/services/platform/hostmanager'
...@@ -9,77 +9,79 @@ import { S_GetDataBaseConfig, GetTCPConfigInfo,GetDataBaseConfig,GetBasicInfo } ...@@ -9,77 +9,79 @@ import { S_GetDataBaseConfig, GetTCPConfigInfo,GetDataBaseConfig,GetBasicInfo }
const BaseConfig = () => { const BaseConfig = () => {
const [currentDataBase, setCurrentDataBase] = useState({}); const [currentDataBase, setCurrentDataBase] = useState({userName:"",password:"",dbName:"",ip:""});
const [currentSiteInfo, setcurrentSiteInfo] = useState(""); const [currentSiteInfo, setcurrentSiteInfo] = useState("");
useEffect(() => { useEffect(() => {
getCurrentConfig() getCurrentConfig()
getSiteCode() getSiteCode()
},[]) }, [])
const getCurrentConfig = () => { const getCurrentConfig = () => {
// S_GetDataBaseConfig({
// _version: 9999,
// _dc: new Date().getTime(),
// }).then(
// res => {
// if (res.success === true) {
// setCurrentDataBase(res)
// }
// }
// )
GetDataBaseConfig().then( GetDataBaseConfig().then(
res =>{ res => {
if(res.code === 0){ if (res.code === 0) {
setCurrentDataBase(res.data) setCurrentDataBase(res.data)
} }
} }
) )
} }
const getSiteCode = () => { const getSiteCode = () => {
// GetTCPConfigInfo({
// _version: 9999,
// _dc: new Date().getTime(),
// }).then(
// res => {
// if (res.say.statusCode === '0000') {
// setcurrentSiteInfo(res)
// }
// }
// )
GetBasicInfo().then( GetBasicInfo().then(
res =>{ res => {
if(res.code === 0 ){ if (res.code === 0) {
setcurrentSiteInfo(res.data) setcurrentSiteInfo(res.data)
} }
} }
) )
} }
// 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}
// </Card>
// </Card>
// </div>
// )
const encrypt = (word) => {
let encryptStr = ""
for(let i = 0;i < word.length;i++){
encryptStr += "*"
}
return encryptStr
}
return ( return (
<div className={styles.base_container}> <div className={styles.base_container}>
<Card title="数据库连接" style={{ width: 300 }}> <div style={{ backgroundColor: "white", padding: "10px", width: "400px" }}>
<Card type="inner" title="服务器IP" style={{ margin: 10 }}> <Descriptions title="" bordered >
{currentDataBase.ip} <Descriptions.Item label="站点编号" span={3}>{currentSiteInfo}</Descriptions.Item>
</Card> <Descriptions.Item label="服务器IP" span={3}>{currentDataBase.ip}</Descriptions.Item>
<Card type="inner" title="数据库名称" style={{ margin: 10 }}> <Descriptions.Item label="数据库名称" span={3}>{currentDataBase.dbName}</Descriptions.Item>
{currentDataBase.dbName} <Descriptions.Item label="登录名" span={1}>{currentDataBase.userName}</Descriptions.Item>
</Card> <Descriptions.Item label="密码" span={1}>{encrypt(currentDataBase.password)}</Descriptions.Item>
</Card> </Descriptions>
<Card title="权限验证" style={{ width: 300, marginLeft: 15 }}> </div>
<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}
</Card>
</Card>
</div> </div>
) )
......
...@@ -200,8 +200,7 @@ const ProxyConfig = () => { ...@@ -200,8 +200,7 @@ const ProxyConfig = () => {
label="地址(IIS)" label="地址(IIS)"
name="IISIPProt" name="IISIPProt"
rules={[{ required: true, message: '请输入服务器地址!' }]} rules={[{ required: true, message: '请输入服务器地址!' }]}
hasFeedback
> >
<Input /> <Input />
</Form.Item> </Form.Item>
......
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