mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 10:50:48 +08:00
release:6.0.2.4
feat: 添加docker公共镜像 refactor: 首次连接失败opcua时,实时重连
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -50,6 +50,13 @@
|
||||
|
||||
**右上角个人弹出框中,切换到物联网关模块**
|
||||
|
||||
## Docker
|
||||
```shell
|
||||
|
||||
docker pull diego2098/thingsgateway:latest
|
||||
|
||||
```
|
||||
|
||||
## 赞助
|
||||
|
||||
[赞助途径](https://kimdiego2098.github.io/docs/1000)
|
||||
|
@@ -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)]" />
|
||||
}
|
||||
|
||||
@* 版本号 *@
|
||||
|
@@ -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>
|
||||
/// 开源地址
|
||||
|
@@ -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)]" />
|
||||
}
|
||||
|
||||
@* 版本号 *@
|
||||
|
@@ -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"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>6.0.2.2</Version>
|
||||
<Version>6.0.2.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@@ -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)
|
||||
{
|
||||
//获取设备连接状态
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user