diff --git a/Oqtane.Client/UI/Routes.razor b/Oqtane.Client/UI/Routes.razor index f4e63cb1..9c876544 100644 --- a/Oqtane.Client/UI/Routes.razor +++ b/Oqtane.Client/UI/Routes.razor @@ -47,6 +47,9 @@ [Parameter] public string AuthorizationToken { get; set; } = ""; + [Parameter] + public string Platform { get; set; } = ""; + [CascadingParameter] HttpContext HttpContext { get; set; } @@ -71,6 +74,7 @@ SiteState.AntiForgeryToken = AntiForgeryToken; SiteState.AuthorizationToken = AuthorizationToken; SiteState.RemoteIPAddress = (_pageState != null) ? _pageState.RemoteIPAddress : ""; + SiteState.Platform = Platform; SiteState.IsPrerendering = (HttpContext != null) ? true : false; _installation = await InstallationService.IsInstalled(); diff --git a/Oqtane.Maui/Main.razor b/Oqtane.Maui/Main.razor index bf24f4c2..f015e0a1 100644 --- a/Oqtane.Maui/Main.razor +++ b/Oqtane.Maui/Main.razor @@ -21,6 +21,7 @@ else Parameters = new Dictionary(); Parameters.Add(new KeyValuePair("RenderMode", RenderModes.Interactive)); Parameters.Add(new KeyValuePair("Runtime", Runtimes.Hybrid)); + Parameters.Add(new KeyValuePair("Platform", DeviceInfo.Current.Platform.ToString())); if (MauiConstants.UseAppSettings) { diff --git a/Oqtane.Maui/MauiProgram.cs b/Oqtane.Maui/MauiProgram.cs index cd81526b..3aded7f5 100644 --- a/Oqtane.Maui/MauiProgram.cs +++ b/Oqtane.Maui/MauiProgram.cs @@ -24,7 +24,7 @@ public static class MauiProgram builder.Services.AddMauiBlazorWebView(); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); -#endif + #endif var apiurl = LoadAppSettings(); diff --git a/Oqtane.Server/Components/App.razor b/Oqtane.Server/Components/App.razor index 567db715..92a46605 100644 --- a/Oqtane.Server/Components/App.razor +++ b/Oqtane.Server/Components/App.razor @@ -62,11 +62,11 @@ { @if (_renderMode == RenderModes.Static) { - + } else { - + } @@ -96,10 +96,11 @@ private string _runtime = Runtimes.Server; private bool _prerender = true; private int _visitorId = -1; + private string _antiForgeryToken = ""; private string _remoteIPAddress = ""; + private string _platform = ""; private string _authorizationToken = ""; private string _language = "en"; - private string _antiForgeryToken = ""; private string _headResources = ""; private string _bodyResources = ""; private string _styleSheets = ""; @@ -116,6 +117,7 @@ { _antiForgeryToken = Antiforgery.GetAndStoreTokens(Context).RequestToken; _remoteIPAddress = Context.Connection.RemoteIpAddress?.ToString() ?? ""; + _platform = System.Runtime.InteropServices.RuntimeInformation.OSDescription; // if framework is installed if (ConfigManager.IsInstalled()) diff --git a/Oqtane.Shared/Shared/SiteState.cs b/Oqtane.Shared/Shared/SiteState.cs index 3a689e6c..4b3394de 100644 --- a/Oqtane.Shared/Shared/SiteState.cs +++ b/Oqtane.Shared/Shared/SiteState.cs @@ -12,6 +12,7 @@ namespace Oqtane.Shared public string AntiForgeryToken { get; set; } // passed from server for use in service calls on client public string AuthorizationToken { get; set; } // passed from server for use in service calls on client public string RemoteIPAddress { get; set; } // passed from server as cannot be reliably retrieved on client + public string Platform { get; set; } public bool IsPrerendering { get; set; } private dynamic _properties;