Added options for navigation assemblies for the router
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
@using System.Net
|
||||
@using System.Reflection
|
||||
@using LucideBlazor
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using Microsoft.Extensions.Options
|
||||
@using Moonlight.Frontend.Configuration
|
||||
@using Moonlight.Frontend.UI.Shared
|
||||
@using Moonlight.Frontend.UI.Shared.Components
|
||||
@using ShadcnBlazor.Emptys
|
||||
@@ -8,12 +11,13 @@
|
||||
@using Moonlight.Frontend.UI.Shared.Partials
|
||||
|
||||
@inject NavigationManager Navigation
|
||||
@inject IOptions<NavigationAssemblyOptions> NavigationOptions
|
||||
|
||||
<ErrorBoundary>
|
||||
<ChildContent>
|
||||
<AuthorizeView>
|
||||
<ChildContent>
|
||||
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(NotFound)">
|
||||
<Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="Assemblies" NotFoundPage="typeof(NotFound)">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
|
||||
<NotAuthorized Context="authRouteViewContext">
|
||||
@@ -71,4 +75,14 @@
|
||||
</div>
|
||||
}
|
||||
</ErrorContent>
|
||||
</ErrorBoundary>
|
||||
</ErrorBoundary>
|
||||
|
||||
@code
|
||||
{
|
||||
private Assembly[] Assemblies;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Assemblies = NavigationOptions.Value.Assemblies.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user