fix(admin): make the role-grants page interactive
The role-grants page is the authoring surface for LdapGroupRoleMapping rows, but it had no @rendermode — so it rendered as static SSR and its @onclick handlers (Add grant, Revoke) never fired. App.razor's <Routes/> sets no global render mode; only ClusterDetail opted in. - Add @rendermode RenderMode.InteractiveServer. - Fix the SignalR hub URL: the page connected to /hubs/fleet-status, but FleetStatusHub is mapped at /hubs/fleet. Static SSR masked this (OnAfterRenderAsync never ran); enabling interactivity surfaced the 404 that terminated the circuit. Verified in-browser: Add grant opens the form, a cluster-scoped grant saves and lists, Revoke removes it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@page "/role-grants"
|
||||
@attribute [Microsoft.AspNetCore.Authorization.Authorize(Policy = "CanPublish")]
|
||||
@rendermode RenderMode.InteractiveServer
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.AspNetCore.SignalR.Client
|
||||
@using ZB.MOM.WW.OtOpcUa.Admin.Hubs
|
||||
@@ -179,7 +180,7 @@ else
|
||||
{
|
||||
if (!firstRender || _hub is not null) return;
|
||||
_hub = new HubConnectionBuilder()
|
||||
.WithUrl(Nav.ToAbsoluteUri("/hubs/fleet-status"))
|
||||
.WithUrl(Nav.ToAbsoluteUri("/hubs/fleet"))
|
||||
.WithAutomaticReconnect()
|
||||
.Build();
|
||||
_hub.On<RoleGrantsChangedMessage>("RoleGrantsChanged", async _ =>
|
||||
|
||||
Reference in New Issue
Block a user