diff --git a/Oqtane.Client/Modules/Admin/Login/Index.razor b/Oqtane.Client/Modules/Admin/Login/Index.razor index 49815187..2a1b4793 100644 --- a/Oqtane.Client/Modules/Admin/Login/Index.razor +++ b/Oqtane.Client/Modules/Admin/Login/Index.razor @@ -87,7 +87,7 @@ private async Task Login() { - if (PageState.Runtime == Runtime.Server) + if (PageState.Runtime == Oqtane.Shared.Runtime.Server) { // server-side Blazor var user = new User(); diff --git a/Oqtane.Client/Themes/Controls/LoginBase.cs b/Oqtane.Client/Themes/Controls/LoginBase.cs index 60bbb781..d923b012 100644 --- a/Oqtane.Client/Themes/Controls/LoginBase.cs +++ b/Oqtane.Client/Themes/Controls/LoginBase.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using Oqtane.Providers; using Oqtane.Services; -using Oqtane.UI; +using Oqtane.Shared; namespace Oqtane.Themes.Controls { diff --git a/Oqtane.Client/UI/PageState.cs b/Oqtane.Client/UI/PageState.cs index cde1779b..325f15d2 100644 --- a/Oqtane.Client/UI/PageState.cs +++ b/Oqtane.Client/UI/PageState.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Oqtane.Models; @@ -19,6 +19,6 @@ namespace Oqtane.UI public string Action { get; set; } public bool EditMode { get; set; } public DateTime LastSyncDate { get; set; } - public Runtime Runtime { get; set; } + public Oqtane.Shared.Runtime Runtime { get; set; } } -} \ No newline at end of file +} diff --git a/Oqtane.Client/UI/Runtime.cs b/Oqtane.Client/UI/Runtime.cs index dcc886b1..2d7e6b00 100644 --- a/Oqtane.Client/UI/Runtime.cs +++ b/Oqtane.Client/UI/Runtime.cs @@ -1,5 +1,8 @@ -namespace Oqtane.UI +using System; + +namespace Oqtane.UI { + [Obsolete("This enum is deprecated and will be removed in the upcoming major release, please use Oqtane.Shared.Runtime instead.")] public enum Runtime { Server, diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index f95f8607..56360ca9 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -560,8 +560,8 @@ return pageresources; } - private Runtime GetRuntime() + private Oqtane.Shared.Runtime GetRuntime() => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")) - ? Runtime.WebAssembly - : Runtime.Server; + ? Oqtane.Shared.Runtime.WebAssembly + : Oqtane.Shared.Runtime.Server; } \ No newline at end of file diff --git a/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs b/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs index 3afb023b..bcfdf9a8 100644 --- a/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs +++ b/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs @@ -8,7 +8,6 @@ using Oqtane.Infrastructure; using Oqtane.Modules; using Oqtane.Services; using Oqtane.Shared; -using Oqtane.UI; // ReSharper disable once CheckNamespace namespace Microsoft.Extensions.DependencyInjection diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index 8671e0f7..b008ee30 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -21,7 +21,6 @@ using Oqtane.Repository; using Oqtane.Security; using Oqtane.Services; using Oqtane.Shared; -using Oqtane.UI; namespace Oqtane { diff --git a/Oqtane.Shared/Enums/Runtime.cs b/Oqtane.Shared/Enums/Runtime.cs new file mode 100644 index 00000000..4cca8235 --- /dev/null +++ b/Oqtane.Shared/Enums/Runtime.cs @@ -0,0 +1,8 @@ +namespace Oqtane.Shared +{ + public enum Runtime + { + Server, + WebAssembly + } +}