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 = () => {
}
)
}
const PingIot = (ip, values) => {
const PingIot = ({ip, values}) => {
PingIOTPlatform({
ip: ip
}).then(
......@@ -100,7 +100,7 @@ const IotConfig = () => {
return (
<div className={styles.iot_container}>
<Card title={`物联平台[${currentIotVersion.data}]`} style={{ width: 430 }}>
<Card title={`物联平台${currentIotVersion.data?`[${currentIotVersion.data}]`:""}`} style={{ width: 430 }}>
<Form
{...layout}
......@@ -110,6 +110,7 @@ const IotConfig = () => {
onFinish={onFinish}
onFinishFailed={onFinishFailed}
>
<div className={styles.section}>物联平台</div>
<Form.Item
label="服务器地址(平台)"
name="IotAddress"
......@@ -118,7 +119,7 @@ const IotConfig = () => {
>
<Input />
</Form.Item>
<div className={styles.section}>EMQ</div>
<Form.Item
label="服务器地址(EMQ)"
name="TcpAddress"
......
......@@ -3,5 +3,11 @@
height: 100%;
width: 100%;
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 { Card } from 'antd'
import { Descriptions } from 'antd'
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 }
const BaseConfig = () => {
const [currentDataBase, setCurrentDataBase] = useState({});
const [currentDataBase, setCurrentDataBase] = useState({userName:"",password:"",dbName:"",ip:""});
const [currentSiteInfo, setcurrentSiteInfo] = useState("");
useEffect(() => {
getCurrentConfig()
getSiteCode()
},[])
getCurrentConfig()
getSiteCode()
}, [])
const getCurrentConfig = () => {
// S_GetDataBaseConfig({
// _version: 9999,
// _dc: new Date().getTime(),
// }).then(
// res => {
// if (res.success === true) {
// setCurrentDataBase(res)
// }
// }
// )
GetDataBaseConfig().then(
res =>{
if(res.code === 0){
res => {
if (res.code === 0) {
setCurrentDataBase(res.data)
}
}
)
}
const getSiteCode = () => {
// GetTCPConfigInfo({
// _version: 9999,
// _dc: new Date().getTime(),
// }).then(
// res => {
// if (res.say.statusCode === '0000') {
// setcurrentSiteInfo(res)
// }
// }
// )
GetBasicInfo().then(
res =>{
if(res.code === 0 ){
res => {
if (res.code === 0) {
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 (
<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>
<div style={{ backgroundColor: "white", padding: "10px", width: "400px" }}>
<Descriptions title="" bordered >
<Descriptions.Item label="站点编号" span={3}>{currentSiteInfo}</Descriptions.Item>
<Descriptions.Item label="服务器IP" span={3}>{currentDataBase.ip}</Descriptions.Item>
<Descriptions.Item label="数据库名称" span={3}>{currentDataBase.dbName}</Descriptions.Item>
<Descriptions.Item label="登录名" span={1}>{currentDataBase.userName}</Descriptions.Item>
<Descriptions.Item label="密码" span={1}>{encrypt(currentDataBase.password)}</Descriptions.Item>
</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>
</Descriptions>
</div>
</div>
)
......
......@@ -200,8 +200,7 @@ const ProxyConfig = () => {
label="地址(IIS)"
name="IISIPProt"
rules={[{ required: true, message: '请输入服务器地址!' }]}
hasFeedback
>
<Input />
</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