release:6.0.2.4

feat: 添加docker公共镜像
refactor: 首次连接失败opcua时,实时重连
This commit is contained in:
Diego
2024-05-31 16:51:30 +08:00
parent 537b79f1c2
commit 7ce2195adb
9 changed files with 68 additions and 11 deletions

View File

@@ -51,6 +51,13 @@ Account: **SuperAdmin**
Password: **111111**

**In the upper-right corner, switch to the IoT Gateway module in the personal popup box**
## Docker
```shell
docker pull diego2098/thingsgateway:latest
```

## Sponsorship


View File

@@ -50,6 +50,13 @@
**右上角个人弹出框中,切换到物联网关模块**
## Docker
```shell
docker pull diego2098/thingsgateway:latest
```
## 赞助
[赞助途径](https://kimdiego2098.github.io/docs/1000)

View File

@@ -37,7 +37,7 @@
@if (WebsiteOption.Value.IsShowAbout)
{
<Button @onclick="ShowAbout" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
<Button @onclick="ShowAbout" class="layout-header-bar d-none d-lg-flex px-2" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
}
@* 版本号 *@

View File

@@ -18,12 +18,12 @@ public class WebsiteOptions
/// <summary>
/// Copyright
/// </summary>
public string Copyright { get; set; }
public string Copyright { get; set; } = "版权所有 © 2023-present Diego";
/// <summary>
/// 是否显示关于页面
/// </summary>
public bool IsShowAbout { get; set; }
public bool IsShowAbout { get; set; } = true;
/// <summary>
/// 开源地址

View File

@@ -33,7 +33,7 @@
TooltipPlacement=Placement.Bottom TooltipText="@Localizer[nameof(FullScreenButton)]" />
@if (WebsiteOption.Value.IsShowAbout)
{
<Button @onclick="ShowAbout" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
<Button @onclick="ShowAbout" class="layout-header-bar d-none d-lg-flex px-2" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
}
@* 版本号 *@

View File

@@ -1,13 +1,24 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
#aspnetcore6.0环境
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
COPY . /app
WORKDIR /app
EXPOSE 7200
#默认web
EXPOSE 7100
#默认冗余
EXPOSE 7101
#默认mqtt
EXPOSE 1883
#默认mqtt
EXPOSE 8083
#默认opcua
EXPOSE 49321
#默认modbus
EXPOSE 502
#图像库
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main contrib non-free" > /etc/apt/sources.list
RUN apt-get update && apt-get -y install libfontconfig1
ENTRYPOINT ["dotnet", "ThingsGateway.Server.dll","--urls","http://*:5000"]
ENTRYPOINT ["dotnet", "ThingsGateway.Server.dll","--urls","http://*:7100"]

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>6.0.2.2</Version>
<Version>6.0.2.4</Version>
</PropertyGroup>
<ItemGroup>

View File

@@ -89,10 +89,19 @@ public class OpcUaMaster : CollectBase
/// <inheritdoc/>
public override bool IsConnected() => _plc?.Connected == true;
private volatile bool connectFirstFail;
protected override async Task ProtectedBeforStartAsync(CancellationToken cancellationToken)
{
_token = cancellationToken;
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
try
{
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
}
catch
{
connectFirstFail = true;
}
await base.ProtectedBeforStartAsync(cancellationToken).ConfigureAwait(false);
}
@@ -220,8 +229,31 @@ public class OpcUaMaster : CollectBase
}
}
private volatile bool connectFirstFailLoged;
protected override async ValueTask ProtectedExecuteAsync(CancellationToken cancellationToken)
{
if (connectFirstFail && !IsConnected())
{
try
{
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
connectFirstFail = false;
}
catch (Exception ex)
{
if (!connectFirstFailLoged)
LogMessage?.LogWarning(ex, "Connect Fail");
connectFirstFailLoged = true;
CurrentDevice.SetDeviceStatus(TimerX.Now, 999, ex.Message);
await Task.Delay(3000);
}
}
else
{
connectFirstFail = false;
}
if (_driverProperties.ActiveSubscribe)
{
//获取设备连接状态

View File

@@ -23,7 +23,7 @@
<ThemeToggle />
@if (WebsiteOption.Value.IsShowAbout)
{
<Button @onclick="ShowAbout" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
<Button @onclick="ShowAbout" class="layout-header-bar d-none d-lg-flex px-2" Icon="fa fa-info" Color="Color.None" TooltipText="@Localizer[nameof(About)]" />
}
@* 版本号 *@
<div class="px-2 navbar-header-text d-none d-lg-block">@_versionString</div>