Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
b82570fc
Commit
b82570fc
authored
Mar 13, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '物联网统一接入接入优化'
parent
dde7705d
Pipeline
#69074
passed with stages
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
57 deletions
+74
-57
IotConfig.jsx
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
+48
-46
TemplateManage.less
...rmCenter/messageManage/templateManage/TemplateManage.less
+0
-1
hostmanager.js
src/services/hostmanager/hostmanager.js
+26
-10
No files found.
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
View file @
b82570fc
...
...
@@ -17,7 +17,7 @@ import {
Modal
,
Space
,
}
from
'antd'
;
import
{
CloseCircleFilled
,
InfoCircleFilled
}
from
'@ant-design/icons'
;
import
{
CloseCircleFilled
,
InfoCircleFilled
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'./IotConfig.less'
;
import
Internet
from
'../../../../assets/images/icons/物联.svg'
;
import
EMQ
from
'../../../../assets/images/icons/EMQ.svg'
;
...
...
@@ -39,6 +39,7 @@ import {
GetGateWay
,
IsIotUpgrade
,
// 判断是否需要升级物联网统一接入平台
IotUpgrade
,
// 升级物联网统一接入平台
GetIotVersion
,
// 检查版本BS还是CS
}
from
'@/services/hostmanager/hostmanager'
;
import
{
GetDbProduct
,
// 获取产品方案配置
...
...
@@ -107,20 +108,17 @@ const IotConfig = props => {
GetDataBaseConfig
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
GetDbProduct
({
...
res
.
data
}).
then
(
ress
=>
{
console
.
log
(
res
.
data
);
console
.
log
(
ress
.
data
.
Project
);
if
(
ress
.
data
.
Project
.
length
>
0
)
{
console
.
log
(
ress
.
data
.
Project
[
ress
.
data
.
Project
.
length
-
1
].
projectName
);
setKeep
(
ress
.
data
.
Project
[
ress
.
data
.
Project
.
length
-
1
].
projectName
);
}
});
setCurrentDataBase
(
res
.
data
);
// 数据库是否已添加
setLoading
(
true
);
CheckIsServiceAdd
({
host
:
res
.
data
.
ip
,
dataBaseName
:
res
.
data
.
dbName
})
CheckIsServiceAdd
({
ip
:
res
.
data
.
ip
})
.
then
(
resdata1
=>
{
setLoading
(
false
);
if
(
resdata1
.
success
)
{
if
(
resdata1
.
code
===
0
)
{
setShow3
(
'inline-block'
);
setShow4
(
'none'
);
getStatus
(
res
.
data
.
ip
,
res
.
data
.
dbName
);
...
...
@@ -133,6 +131,7 @@ const IotConfig = props => {
}
})
.
catch
(
err
=>
{
message
.
error
(
'网络异常'
);
setLoading
(
false
);
});
}
...
...
@@ -141,21 +140,22 @@ const IotConfig = props => {
const
getStatus
=
(
x
,
y
)
=>
{
// 查询是否禁用
GetServiceInfo
({
host
:
x
,
dataBaseName
:
y
})
GetServiceInfo
({
ip
:
x
})
.
then
(
resdata
=>
{
setDbStatus
(
resdata
.
response
.
statusText
);
setProcessLength
(
resdata
.
response
.
loadingProgress
*
100
);
if
(
resdata
.
response
.
statusText
!=
'正常'
&&
resdata
.
response
.
statusText
!=
'已禁用'
)
{
if
(
resdata
.
code
===
0
)
{
setDbStatus
(
resdata
.
data
.
statusText
);
setProcessLength
(
resdata
.
data
.
loadingProgress
*
100
);
if
(
resdata
.
data
.
statusText
!=
'正常'
&&
resdata
.
data
.
statusText
!=
'已禁用'
)
{
setBuStatus
(
'启动中'
);
setSwitchStatus
(
true
);
time
=
setTimeout
(()
=>
{
getStatus
(
x
,
y
);
},
1000
);
}
else
{
if
(
resdata
.
response
.
statusText
==
'正常'
)
{
if
(
resdata
.
data
.
statusText
==
'正常'
)
{
setBuStatus
(
'停止'
);
}
if
(
resdata
.
response
.
statusText
==
'已禁用'
)
{
if
(
resdata
.
data
.
statusText
==
'已禁用'
)
{
setBuStatus
(
'启动'
);
}
if
(
time
)
{
...
...
@@ -165,18 +165,21 @@ const IotConfig = props => {
setSwitchStatus
(
false
);
}
if
(
resdata
.
response
.
statusText
==
'正常'
)
{
if
(
resdata
.
data
.
statusText
==
'正常'
)
{
setCurrentConfig
(
true
);
}
else
{
setCurrentConfig
(
false
);
}
}
else
{
message
.
error
(
resdata
.
msg
);
}
})
.
catch
(
err
=>
{
if
(
time
)
{
clearTimeout
(
time
);
time
=
null
;
}
message
.
error
(
'访问异常请稍后再试'
);
//
message.error('访问异常请稍后再试');
});
};
...
...
@@ -205,8 +208,7 @@ const IotConfig = props => {
Object
.
keys
(
currentIotConfig
).
forEach
(
k
=>
{
obj
[
k
]
=
res
.
data
[
k
];
});
console
.
log
(
obj
);
PingIOTPlatform
({
GetIotVersion
({
ip
:
obj
.
IotAddress
?
obj
.
IotAddress
:
'127.0.0.1'
,
}).
then
(
resdata
=>
{
if
(
resdata
.
code
===
0
)
{
...
...
@@ -214,21 +216,25 @@ const IotConfig = props => {
GetGateWay
().
then
(
resda
=>
{
if
(
resda
.
code
===
0
)
{
if
(
resda
.
data
===
false
)
{
setFlag
(
0
);
setGetWayVisible
(
true
);
}
else
{
HealthCheck
()
.
then
(
ress
=>
{
if
(
ress
.
success
)
{
setFlag
(
1
);
getCurrentConfig
();
getSiteCode
();
}
else
{
setFlag
(
0
);
}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
// HealthCheck()
// .then(ress => {
// if (ress.success) {
// setFlag(1);
// getCurrentConfig();
// getSiteCode();
// } else {
// setFlag(0);
// }
// })
// .catch(err => {
// console.log(err);
// });
}
}
});
...
...
@@ -325,8 +331,6 @@ const IotConfig = props => {
// 添加当前连接数据库
const
PingIot2
=
()
=>
{
console
.
log
(
buStatus
);
console
.
log
(
show3
);
if
(
show3
===
'inline-block'
)
{
// 数据库已添加
if
(
buStatus
===
'停止'
)
{
...
...
@@ -338,15 +342,10 @@ const IotConfig = props => {
// 数据库未添加
setLoading
(
true
);
AddDB
({
host
:
currentDataBase
.
ip
,
user
:
currentDataBase
.
userName
,
pwd
:
currentDataBase
.
password
,
dataBaseName
:
currentDataBase
.
dbName
,
siteCode
:
currentSiteInfo
,
name
:
keep
,
ip
:
currentDataBase
.
ip
,
}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setShow3
(
'inline-block'
);
setShow4
(
'none'
);
message
.
success
(
'添加成功!'
);
...
...
@@ -405,12 +404,11 @@ const IotConfig = props => {
setSwitchStatus
(
true
);
setLoading
(
true
);
DepositServiceEnable
({
host
:
currentDataBase
.
ip
,
dataBaseName
:
currentDataBase
.
dbName
,
ip
:
currentDataBase
.
ip
,
}).
then
(
res
=>
{
setLoading
(
false
);
getStatus
(
currentDataBase
.
ip
,
currentDataBase
.
dbName
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
// setCurrentConfig(checked);
message
.
success
(
res
.
msg
);
}
else
{
...
...
@@ -420,11 +418,10 @@ const IotConfig = props => {
}
else
{
setLoading
(
true
);
DepositServiceDisable
({
host
:
currentDataBase
.
ip
,
dataBaseName
:
currentDataBase
.
dbName
,
ip
:
currentDataBase
.
ip
,
}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setDbStatus
(
'已禁用'
);
setBuStatus
(
'启动'
);
setProcessLength
(
0
);
...
...
@@ -502,11 +499,11 @@ const IotConfig = props => {
placeholder=
"请输入服务地址"
/>
</
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
()
=>
PingIot1
()
}
style=
{
{
marginLeft
:
'25
px'
}
}
>
<
Button
onClick=
{
()
=>
PingIot1
()
}
style=
{
{
marginLeft
:
'-88
px'
}
}
>
测试连接
</
Button
>
{
upgrade
&&
(
<
Tooltip
title=
"添加物联统一接入平台的子网站,并导入网页菜单数据"
>
<>
<
Button
type=
"primary"
onClick=
{
()
=>
PingIotUpdata
()
}
...
...
@@ -514,7 +511,12 @@ const IotConfig = props => {
>
平台升级
</
Button
>
<
Tooltip
title=
"添加物联统一接入平台的子网站,并导入网页菜单数据"
>
<
QuestionCircleOutlined
style=
{
{
fontSize
:
'18px'
,
marginLeft
:
'10px'
,
marginTop
:
'12px'
}
}
/>
</
Tooltip
>
</>
)
}
<
span
style=
{
{
display
:
show1
}
}
>
<
img
...
...
@@ -633,9 +635,9 @@ const IotConfig = props => {
visible=
{
getWayVisible
}
title=
"提示"
width=
"350px"
closable
=
{
false
}
//
maskClosable={false}
//
onCancel={() => setGetWayVisible(false)}
closable
maskClosable=
{
false
}
onCancel=
{
()
=>
setGetWayVisible
(
false
)
}
all
footer=
{
<
Space
>
...
...
src/pages/platformCenter/messageManage/templateManage/TemplateManage.less
View file @
b82570fc
...
...
@@ -18,7 +18,6 @@
align-items: center;
.template_type {
height: 60px;
display: flex;
flex-direction: row;
justify-content: flex-start;
...
...
src/services/hostmanager/hostmanager.js
View file @
b82570fc
...
...
@@ -24,23 +24,39 @@ export const GetTCPConfigInfo = param =>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/GetTCPConfigInfo`
,
param
);
export
const
PingIOTPlatform
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/PingIOTPlatform`
,
param
);
// 判断是否需要升级物联网统一接入平台
export
const
IsIotUpgrade
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/IsIotUpgrade`
,
param
);
// 升级物联网统一接入平台
export
const
IotUpgrade
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/IotUpgrade`
,
param
);
export
const
SaveTcpAddress
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveTcpAddress`
,
param
);
// 健康检查接口
export
const
HealthCheck
=
param
=>
get
(
`/Iot/api/HealthCheck`
,
param
);
export
const
GetIotVersion
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/GetIotVersion`
,
param
);
// 判断数据库服务是否已添加
export
const
CheckIsServiceAdd
=
param
=>
post
(
`/Iot/api/DB/CheckIsServiceAdd`
,
param
);
export
const
CheckIsServiceAdd
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/CheckIsServiceAdd`
,
param
);
// 查询当前数据库服务状态信息
export
const
GetServiceInfo
=
param
=>
post
(
`/Iot/api/DB
/GetServiceInfo`
,
param
);
export
const
GetServiceInfo
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager
/GetServiceInfo`
,
param
);
// 添加数据库
export
const
AddDB
=
param
=>
post
(
`/Iot/api/DB
/AddDBV2`
,
param
);
export
const
AddDB
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager
/AddDBV2`
,
param
);
// 停止数据库服务
export
const
DepositServiceDisable
=
param
=>
post
(
`/Iot/api/DB/DepositServiceDisable`
,
param
);
export
const
DepositServiceDisable
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/DepositServiceDisable`
,
param
);
// 启用数据库服务
export
const
DepositServiceEnable
=
param
=>
post
(
`/Iot/api/DB/DepositServiceEnable`
,
param
);
export
const
DepositServiceEnable
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/DepositServiceEnable`
,
param
);
// 升级物联网统一接入平台
export
const
IotUpgrade
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/IotUpgrade`
,
param
);
export
const
SaveTcpAddress
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveTcpAddress`
,
param
);
// 健康检查接口
export
const
HealthCheck
=
param
=>
get
(
`/Iot/api/HealthCheck`
,
param
);
// // 判断数据库服务是否已添加
// export const CheckIsServiceAdd = param => post(`/Iot/api/DB/CheckIsServiceAdd`, param);
// // 查询当前数据库服务状态信息
// export const GetServiceInfo = param => post(`/Iot/api/DB/GetServiceInfo`, param);
// // 添加数据库
// export const AddDB = param => post(`/Iot/api/DB/AddDBV2`, param);
// // 停止数据库服务
// export const DepositServiceDisable = param => post(`/Iot/api/DB/DepositServiceDisable`, param);
// // 启用数据库服务
// export const DepositServiceEnable = param => post(`/Iot/api/DB/DepositServiceEnable`, param);
// 消息平台接口
export
const
GetMessageConfigInfo
=
param
=>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment