fix(routing): InteractiveServer routing, WASM interactivity declared at layout level
Routes moves to InteractiveServer so the server router always sees all assemblies (including AuthBlocksWeb). MainLayout declares @rendermode InteractiveWebAssembly — the single source of WASM interactivity for all public pages. CmsLayout in DeepDrftCms provides a server-rendered admin shell without the audio dock. Assembly-level _Imports.razor files set the default layout for each group; no per-page rendermode declarations needed. Routes.razor moves to the server host (its correct home) carrying the full AdditionalAssemblies list.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@using DeepDrftWeb.Client.Controls
|
||||
@rendermode InteractiveWebAssembly
|
||||
@using DeepDrftWeb.Client.Controls
|
||||
@using DeepDrftWeb.Client.Controls.AudioPlayerBar
|
||||
@using DeepDrftWeb.Client.Services
|
||||
@using DeepDrftWeb.Client.Common
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<Router AppAssembly="typeof(_Imports).Assembly">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)">
|
||||
<NotAuthorized>
|
||||
@{
|
||||
NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
|
||||
}
|
||||
</NotAuthorized>
|
||||
</AuthorizeRouteView>
|
||||
</Found>
|
||||
<NotFound>
|
||||
@{
|
||||
// Routes owned by server-side assemblies (e.g. /account/*) are not visible to the
|
||||
// WASM router. Force a full-page reload so the server router handles them instead.
|
||||
var path = new Uri(NavigationManager.Uri).AbsolutePath;
|
||||
if (path.StartsWith("/account", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigationManager.Uri, forceLoad: true);
|
||||
}
|
||||
}
|
||||
</NotFound>
|
||||
</Router>
|
||||
@@ -10,4 +10,5 @@
|
||||
@using MudBlazor
|
||||
@using MudBlazor.Services
|
||||
@using MudBlazor.ThemeManager
|
||||
@using DeepDrftWeb.Client.Common
|
||||
@using DeepDrftWeb.Client.Common
|
||||
@layout DeepDrftWeb.Client.Layout.MainLayout
|
||||
Reference in New Issue
Block a user