diff --git a/src/Admin/ThingsGateway.Admin.Application/Entity/SysUser.cs b/src/Admin/ThingsGateway.Admin.Application/Entity/SysUser.cs index f2403c53f..dc8f311c1 100644 --- a/src/Admin/ThingsGateway.Admin.Application/Entity/SysUser.cs +++ b/src/Admin/ThingsGateway.Admin.Application/Entity/SysUser.cs @@ -170,14 +170,14 @@ public class SysUser : BaseEntity /// [SugarColumn(IsIgnore = true, IsJson = true)] [AutoGenerateColumn(Ignore = true)] - public List OrgAndPosIdList { get; set; } = new List(); + public List? OrgAndPosIdList { get; set; } = new List(); /// /// 主管信息 /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public UserSelectorOutput DirectorInfo { get; set; } + public UserSelectorOutput? DirectorInfo { get; set; } #endregion @@ -188,35 +188,35 @@ public class SysUser : BaseEntity /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public Dictionary> ButtonCodeList { get; set; } = new(); + public Dictionary>? ButtonCodeList { get; set; } = new(); /// /// 权限码集合 /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public HashSet PermissionCodeList { get; set; } = new(); + public HashSet? PermissionCodeList { get; set; } = new(); /// /// 角色ID集合 /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public HashSet RoleIdList { get; set; } = new(); + public HashSet? RoleIdList { get; set; } = new(); /// /// 机构及以下机构ID集合 /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public HashSet ScopeOrgChildList { get; set; } + public HashSet? ScopeOrgChildList { get; set; } /// /// 模块集合 /// [SugarColumn(IsIgnore = true)] [AutoGenerateColumn(Ignore = true)] - public List ModuleList { get; set; } = new(); + public List? ModuleList { get; set; } = new(); /// /// 租户Id diff --git a/src/Admin/ThingsGateway.Admin.Application/Services/Auth/Dto/AuthOutput.cs b/src/Admin/ThingsGateway.Admin.Application/Services/Auth/Dto/AuthOutput.cs index 1bade499e..e4ae6da2e 100644 --- a/src/Admin/ThingsGateway.Admin.Application/Services/Auth/Dto/AuthOutput.cs +++ b/src/Admin/ThingsGateway.Admin.Application/Services/Auth/Dto/AuthOutput.cs @@ -58,7 +58,7 @@ public class LoginOutput /// /// 模块列表 /// - public IEnumerable ModuleList { get; set; } = Enumerable.Empty(); + public IEnumerable? ModuleList { get; set; } = Enumerable.Empty(); /// /// 刷新Token diff --git a/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/AppConfig.cs b/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/AppConfig.cs index ee3319a20..bb6e3b833 100644 --- a/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/AppConfig.cs +++ b/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/AppConfig.cs @@ -15,17 +15,17 @@ public class AppConfig /// /// 登录策略 /// - public LoginPolicy LoginPolicy { get; set; } + public LoginPolicy? LoginPolicy { get; set; } /// /// 页面策略 /// - public PagePolicy PagePolicy { get; set; } + public PagePolicy? PagePolicy { get; set; } /// /// 密码策略 /// - public PasswordPolicy PasswordPolicy { get; set; } + public PasswordPolicy? PasswordPolicy { get; set; } - public WebsitePolicy WebsitePolicy { get; set; } + public WebsitePolicy? WebsitePolicy { get; set; } } diff --git a/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/PagePolicy.cs b/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/PagePolicy.cs index d0e74e519..b0ebfaff5 100644 --- a/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/PagePolicy.cs +++ b/src/Admin/ThingsGateway.Admin.Application/Services/Dict/Dto/PagePolicy.cs @@ -15,5 +15,5 @@ public class PagePolicy /// /// 系统默认快捷方式菜单ID列表 /// - public List Shortcuts { get; set; } = new(); + public List? Shortcuts { get; set; } = new(); } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 13acaba84..a0f1884ce 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ 10.9.44 10.9.44 - 10.9.44 + 10.9.45 2.9.20 10.9.20 8.0.18 diff --git a/src/Foundation/ThingsGateway.Foundation/Variable/IVariable.cs b/src/Foundation/ThingsGateway.Foundation/Variable/IVariable.cs index c3a4ff607..7dba3eecf 100644 --- a/src/Foundation/ThingsGateway.Foundation/Variable/IVariable.cs +++ b/src/Foundation/ThingsGateway.Foundation/Variable/IVariable.cs @@ -43,7 +43,7 @@ public interface IVariable /// /// 数据转换规则 /// - IThingsGatewayBitConverter ThingsGatewayBitConverter { get; set; } + IThingsGatewayBitConverter? ThingsGatewayBitConverter { get; set; } /// /// 实时值 @@ -53,7 +53,7 @@ public interface IVariable /// /// 打包变量 /// - IVariableSource VariableSource { get; set; } + IVariableSource? VariableSource { get; set; } object? RawValue { get; } void SetNoChangedValue(DateTime dateTime); diff --git a/src/Foundation/ThingsGateway.Foundation/Variable/VariableClass.cs b/src/Foundation/ThingsGateway.Foundation/Variable/VariableClass.cs index fa48e29db..b7fc3e5b4 100644 --- a/src/Foundation/ThingsGateway.Foundation/Variable/VariableClass.cs +++ b/src/Foundation/ThingsGateway.Foundation/Variable/VariableClass.cs @@ -50,7 +50,7 @@ public class VariableClass : IVariable /// /// 数据转换规则 /// - public virtual IThingsGatewayBitConverter ThingsGatewayBitConverter { get; set; } + public virtual IThingsGatewayBitConverter? ThingsGatewayBitConverter { get; set; } /// /// 实时值 @@ -60,7 +60,7 @@ public class VariableClass : IVariable /// /// IVariableSource /// - public IVariableSource VariableSource { get; set; } + public IVariableSource? VariableSource { get; set; } public object? RawValue { get; private set; } public void SetNoChangedValue(DateTime dateTime) diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Model/PluginInfo.cs b/src/Gateway/ThingsGateway.Gateway.Application/Model/PluginInfo.cs index ab4e35a85..ffbf9363d 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Model/PluginInfo.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Model/PluginInfo.cs @@ -21,7 +21,7 @@ public class PluginInfo /// 插件文件名称.插件类型名称 /// [AutoGenerateColumn(Ignore = true)] - public List Children { get; set; } = new(); + public List? Children { get; set; } = new(); /// /// 插件文件名称.插件类型名称 diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.cs b/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.cs index e7848a512..e27b3ae5c 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.cs @@ -44,10 +44,10 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable private object _value; private object lastSetValue; private object rawValue; - private DeviceRuntime deviceRuntime; - private IVariableSource variableSource; - private VariableMethod variableMethod; - private IThingsGatewayBitConverter thingsGatewayBitConverter; + private DeviceRuntime? deviceRuntime; + private IVariableSource? variableSource; + private VariableMethod? variableMethod; + private IThingsGatewayBitConverter? thingsGatewayBitConverter; /// /// 设置变量值与时间/质量戳 diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.property.cs b/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.property.cs index d0f705fbb..76ce50011 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.property.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Model/VariableRunTime.property.cs @@ -114,7 +114,7 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable [Newtonsoft.Json.JsonIgnore] [System.Text.Json.Serialization.JsonIgnore] [AutoGenerateColumn(Ignore = true)] - public DeviceRuntime DeviceRuntime { get => deviceRuntime; set => deviceRuntime = value; } + public DeviceRuntime? DeviceRuntime { get => deviceRuntime; set => deviceRuntime = value; } /// /// VariableSource @@ -123,7 +123,7 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable [System.Text.Json.Serialization.JsonIgnore] [MapperIgnore] [AutoGenerateColumn(Ignore = true)] - public IVariableSource VariableSource { get => variableSource; set => variableSource = value; } + public IVariableSource? VariableSource { get => variableSource; set => variableSource = value; } /// /// VariableMethod @@ -132,7 +132,7 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable [System.Text.Json.Serialization.JsonIgnore] [MapperIgnore] [AutoGenerateColumn(Ignore = true)] - public VariableMethod VariableMethod { get => variableMethod; set => variableMethod = value; } + public VariableMethod? VariableMethod { get => variableMethod; set => variableMethod = value; } @@ -142,7 +142,7 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable [Newtonsoft.Json.JsonIgnore] [System.Text.Json.Serialization.JsonIgnore] [AutoGenerateColumn(Ignore = true)] - public IThingsGatewayBitConverter ThingsGatewayBitConverter { get => thingsGatewayBitConverter; set => thingsGatewayBitConverter = value; } + public IThingsGatewayBitConverter? ThingsGatewayBitConverter { get => thingsGatewayBitConverter; set => thingsGatewayBitConverter = value; } diff --git a/src/ThingsGateway.Server/Layout/BlazorApp.razor b/src/ThingsGateway.Server/Layout/BlazorApp.razor index 7ae86c33c..65d20681c 100644 --- a/src/ThingsGateway.Server/Layout/BlazorApp.razor +++ b/src/ThingsGateway.Server/Layout/BlazorApp.razor @@ -3,7 +3,6 @@ @using Microsoft.Extensions.Localization @using ThingsGateway.Razor @inject IHostEnvironment Env -@inject IStringLocalizer Localizer @namespace ThingsGateway.Server @@ -22,31 +21,16 @@ ThingsGateway - @{ - #if !NET8_0 - } - - - @{ - #else - } - - - - - - - @{ - #endif - } + + @* *@ @@ -58,7 +42,7 @@ - + diff --git a/src/ThingsGateway.Server/Layout/BlazorAppNet8.razor b/src/ThingsGateway.Server/Layout/BlazorAppNet8.razor new file mode 100644 index 000000000..abf5c7ac3 --- /dev/null +++ b/src/ThingsGateway.Server/Layout/BlazorAppNet8.razor @@ -0,0 +1,55 @@ +@using BootstrapBlazor.Components +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.Extensions.Localization +@using ThingsGateway.Razor +@inject IHostEnvironment Env +@namespace ThingsGateway.Server + + + + + + + + + + + + + + + + ThingsGateway + + + + + + + + + @* *@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ThingsGateway.Server/Program/Program.cs b/src/ThingsGateway.Server/Program/Program.cs index 8f088c544..837cebbed 100644 --- a/src/ThingsGateway.Server/Program/Program.cs +++ b/src/ThingsGateway.Server/Program/Program.cs @@ -94,10 +94,14 @@ public class Program }) .Configure(app => { -#if NET8_0_OR_GREATER +#if NET9_0_OR_GREATER app.MapRazorComponents() .AddAdditionalAssemblies(App.RazorAssemblies.Distinct().Where(a => a != typeof(Program).Assembly).ToArray()) .AddInteractiveServerRenderMode(); +#elif NET8_0_OR_GREATER + app.MapRazorComponents() + .AddAdditionalAssemblies(App.RazorAssemblies.Distinct().Where(a => a != typeof(Program).Assembly).ToArray()) + .AddInteractiveServerRenderMode(); #else app.MapBlazorHub(); diff --git a/src/ThingsGateway.Server/ThingsGateway.Server.csproj b/src/ThingsGateway.Server/ThingsGateway.Server.csproj index 4182a3c7b..3007c4014 100644 --- a/src/ThingsGateway.Server/ThingsGateway.Server.csproj +++ b/src/ThingsGateway.Server/ThingsGateway.Server.csproj @@ -80,17 +80,27 @@ Never - + + + + + + + + + + + @@ -143,5 +153,4 @@ -