diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/EndpointRouteBuilderExtensions.cs b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/EndpointRouteBuilderExtensions.cs new file mode 100644 index 0000000..90f7a30 --- /dev/null +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/EndpointRouteBuilderExtensions.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; + +namespace ZB.MOM.WW.OtOpcUa.AdminUI; + +public static class EndpointRouteBuilderExtensions +{ + /// + /// Mounts the AdminUI Razor components and the AdminUI static asset pipeline at the root. + /// Call from the fused Host's Program.cs alongside app.MapOtOpcUaAuth(). + /// + /// Razor component migration from legacy OtOpcUa.Admin/Components/ is staged for + /// follow-up F15 — 47 .razor files plus codebehind. Until then this extension wires the + /// Blazor pipeline but the only built-in components are the v2-native ones added in this + /// library (e.g. Deployments, Task 52). + /// + public static IEndpointRouteBuilder MapAdminUI(this IEndpointRouteBuilder app) + where TApp : IComponent + { + app.MapRazorComponents() + .AddInteractiveServerRenderMode(); + return app; + } + + public static IServiceCollection AddAdminUI(this IServiceCollection services) + { + services.AddRazorComponents().AddInteractiveServerComponents(); + return services; + } +}