Set page render mode
This commit is contained in:
@@ -6,14 +6,26 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<ImportMap />
|
||||
<HeadOutlet />
|
||||
<HeadOutlet @rendermode="PageRenderMode" />
|
||||
</head>
|
||||
<body>
|
||||
<Routes/>
|
||||
<Routes @rendermode="PageRenderMode" />
|
||||
<script src="/_framework/blazor.web.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@code {
|
||||
|
||||
[CascadingParameter]
|
||||
private HttpContext HttpContext { get; set; } = default!;
|
||||
|
||||
private IComponentRenderMode? PageRenderMode
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
return HttpContext.AcceptsInteractiveRouting() ? InteractiveServer : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@using System.Reflection
|
||||
@using SPTarkov.Server.Web.Components.Layout
|
||||
|
||||
<Router AppAssembly="@typeof(SPTWeb).Assembly">
|
||||
<Router AppAssembly="@typeof(SPTWeb).Assembly" AdditionalAssemblies="SPTWeb.SptWebModsAssemblies">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(BaseMainLayout)" />
|
||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using MudBlazor.Services;
|
||||
using SPTarkov.Server.Core.Models.Spt.Mod;
|
||||
using SPTarkov.Server.Web.Components;
|
||||
@@ -8,6 +9,7 @@ namespace SPTarkov.Server.Web;
|
||||
public static class SPTWeb
|
||||
{
|
||||
internal static IEnumerable<SptMod> SptWebMods = [];
|
||||
internal static List<Assembly> SptWebModsAssemblies = [];
|
||||
|
||||
public static void InitializeSptBlazor(this WebApplicationBuilder builder, IReadOnlyList<SptMod> sptMods)
|
||||
{
|
||||
@@ -39,6 +41,7 @@ public static class SPTWeb
|
||||
foreach (var assembly in mod.Assemblies)
|
||||
{
|
||||
razorBuilder.AddAdditionalAssemblies(assembly);
|
||||
SptWebModsAssemblies.Add(assembly);
|
||||
}
|
||||
|
||||
var modAssembly = mod.ModMetadata.GetType().Assembly;
|
||||
|
||||
Reference in New Issue
Block a user