release:6.0.4.42

refactor: 支持blazor hybrid;
feat(s7): 支持多写;
This commit is contained in:
Diego
2024-07-30 19:57:23 +08:00
parent 150435f24e
commit d15464b1ae
6 changed files with 55 additions and 7 deletions

View File

@@ -96,9 +96,10 @@ public class OperDescAttribute : MoAttribute
{
try
{
if (_logMessageQueue.Count > 0)
var data = _logMessageQueue.ToListWithDequeue(); // 从日志队列中获取数据
if (data.Count > 0)
{
await db.InsertableWithAttr(_logMessageQueue.ToListWithDequeue()).ExecuteCommandAsync();//入库
await db.InsertableWithAttr(data).ExecuteCommandAsync();//入库
}
await Task.Delay(3000, appLifetime?.ApplicationStopping ?? default).ConfigureAwait(false);
}

View File

@@ -93,7 +93,7 @@ public class ChannelThread
CycleInterval = Math.Min(CycleInterval, MinCycleInterval);
}
}
await Task.Delay(hardwareInfoService.HardwareInfoConfig.RealInterval * 1000, appLifetime.ApplicationStopping).ConfigureAwait(false);
await Task.Delay(hardwareInfoService.HardwareInfoConfig.RealInterval * 1000, appLifetime?.ApplicationStopping ?? default).ConfigureAwait(false);
}
catch (OperationCanceledException)
{

View File

@@ -243,9 +243,11 @@ public class RpcService : IRpcService
try
{
var data = _logQueues.ToListWithDequeue(); // 从日志队列中获取数据
// 将数据插入到数据库中
await db.InsertableWithAttr(data).ExecuteCommandAsync(appLifetime.ApplicationStopping);
if(data.Count>0)
{
// 将数据插入到数据库中
await db.InsertableWithAttr(data).ExecuteCommandAsync(appLifetime.ApplicationStopping);
}
}
catch (Exception ex)
{

View File

@@ -19,7 +19,9 @@ using System.Text.Encodings.Web;
using System.Text.Unicode;
using ThingsGateway.Admin.Application;
using ThingsGateway.Debug;
using ThingsGateway.Photino;
using ThingsGateway.Razor;
namespace ThingsGateway.Server;
@@ -52,6 +54,8 @@ internal class Program
builder.RootComponents.Add<Routes>("#app");
builder.Services.AddScoped<IPlatformService, PhotinoPlatformService>();
var app = builder.Build();
app.Services.UseServicesWithoutWeb();

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
// 此代码版权除特别声明外的代码归作者本人Diego所有
// 源代码使用协议遵循本仓库的开源协议及附加协议
// Gitee源代码仓库https://gitee.com/diego2098/ThingsGateway
// Github源代码仓库https://github.com/kimdiego2098/ThingsGateway
// 使用文档https://kimdiego2098.github.io/
// QQ群605534569
//------------------------------------------------------------------------------
using ThingsGateway.Razor;
namespace ThingsGateway.Debug;
public class PhotinoPlatformService : IPlatformService
{
public Task OnLogExport(string logPath)
{
OpenFolder(logPath);
return Task.CompletedTask;
}
private void OpenFolder(string path)
{
// Normalize the path for the current operating system
path = System.IO.Path.GetFullPath(path); // Ensure the path is absolute
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
{
System.Diagnostics.Process.Start("explorer.exe", path);
}
else if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux))
{
System.Diagnostics.Process.Start("xdg-open", path);
}
else if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX))
{
System.Diagnostics.Process.Start("open", path);
}
}
}

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>6.0.4.41</Version>
<Version>6.0.4.42</Version>
</PropertyGroup>
<ItemGroup>