设备状态上报

This commit is contained in:
iioter 2022-05-06 15:56:05 +08:00
parent 43fd064d48
commit c69eb13b1b
10 changed files with 32 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -104,6 +104,7 @@ namespace IoTGateway
{ ".css", "text/css" },
{ ".wasm", "application/wasm" },
{ ".png", "image/png" },
{ ".jpg", "image/jpg" },
{ ".woff", "application/font-woff" },
{ ".woff2", "application/font-woff" },
{ ".ico", "image/x-icon" },

View File

@ -56,19 +56,36 @@
</div>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-col-md2">
<div class="layui-card">
<div class="layui-card-header">设备状态</div>
<div class="layui-card-header">公众号</div>
<div class="layui-card-body">
<wt:chart is-horizontal="true" show-legend="true" show-tooltip="true" type="Pie" height="300" trigger-url="/Home/GetDeviceChart" />
<img src="/images/公众号.jpg" alt="" height="170">
</div>
</div>
</div>
<div class="layui-col-md8">
<div class="layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">设备状态</div>
<div class="layui-card-body">
<wt:chart is-horizontal="true" show-legend="true" show-tooltip="true" type="Pie" height="200" trigger-url="/Home/GetDeviceChart" />
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-card">
<div class="layui-card-header">设备变量状态</div>
<div class="layui-card-body">
<wt:chart show-legend="false" show-tooltip="true" type="Bar" height="300" trigger-url="/Home/GetDeviceVariableChart" />
<wt:chart show-legend="false" show-tooltip="true" type="Bar" height="200" trigger-url="/Home/GetDeviceVariableChart" />
</div>
</div>
</div>
<div class="layui-col-md2">
<div class="layui-card">
<div class="layui-card-header">小程序</div>
<div class="layui-card-body">
<img src="/images/小程序.jpg" alt="" height="170">
</div>
</div>
</div>

View File

@ -37,6 +37,8 @@
<div class="loginBody app-login-back-@bgnumber" style="flex: 1 1 auto !important; ">
<header class="login-header">
<img src="/images/logo.png" alt="" height="48">
<img src="/images/公众号.jpg" alt="" height="150">
<img src="/images/小程序.jpg" alt="" style="float:right" height="150">
</header>
<div class="login-content">
<div class="login-form">

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -46,13 +46,12 @@ namespace Plugin
}
}
}
//上传客户端属性
myMqttClient.UploadAttributeAsync(device.DeviceName, device.DeviceConfigs.Where(x => x.DataSide == DataSide.ClientSide).ToDictionary(x => x.DeviceConfigName, x => x.Value));
task = Task.Run(() =>
{
Thread.Sleep(5000);
Thread.Sleep(5000);//上传客户端属性
myMqttClient.UploadAttributeAsync(device.DeviceName, device.DeviceConfigs.Where(x => x.DataSide == DataSide.ClientSide).ToDictionary(x => x.DeviceConfigName, x => x.Value));
while (true)
{
if (tokenSource.IsCancellationRequested)
@ -137,7 +136,10 @@ namespace Plugin
else
{
if (driver.Connect())
{
lastConnected = true;
_myMqttClient.DeviceConnected(_device.DeviceName);
}
else if (lastConnected)
{
lastConnected = false;