mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-21 03:01:28 +08:00
release:6.0.4.42
refactor: 支持blazor hybrid; feat(s7): 支持多写;
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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();
|
||||
|
41
src/ThingsGateway.Photino/Services/PhotinoPlatformService.cs
Normal file
41
src/ThingsGateway.Photino/Services/PhotinoPlatformService.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>6.0.4.41</Version>
|
||||
<Version>6.0.4.42</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user