feat(adminui): FleetStatusHub + AlertHub + MapOtOpcUaHubs (broadcaster bridge tracked as F16)
This commit is contained in:
9
src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Hubs/AlertHub.cs
Normal file
9
src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Hubs/AlertHub.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
|
||||||
|
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
|
||||||
|
|
||||||
|
/// <summary>Browser-facing alert / toast push channel. Bridge wiring staged for F16.</summary>
|
||||||
|
public sealed class AlertHub : Hub
|
||||||
|
{
|
||||||
|
public const string Endpoint = "/hubs/alerts";
|
||||||
|
}
|
||||||
18
src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Hubs/FleetStatusHub.cs
Normal file
18
src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Hubs/FleetStatusHub.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
using ZB.MOM.WW.OtOpcUa.Commons.Messages.Fleet;
|
||||||
|
|
||||||
|
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Browser-facing fleet-status push channel. Subscribers receive <see cref="FleetStatusChanged"/>
|
||||||
|
/// snapshots whenever the admin-role <c>FleetStatusBroadcaster</c> publishes a diff.
|
||||||
|
///
|
||||||
|
/// Server-side bridge from <c>FleetStatusBroadcaster.broadcast</c> → <c>IHubContext<FleetStatusHub></c>
|
||||||
|
/// is staged for follow-up F16. For now the hub is a passive channel; SignalR clients connect
|
||||||
|
/// and stay idle until the bridge lands.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class FleetStatusHub : Hub
|
||||||
|
{
|
||||||
|
public const string Endpoint = "/hubs/fleet-status";
|
||||||
|
public const string MethodName = "fleetStatusChanged";
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
|
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
|
||||||
|
|
||||||
|
public static class HubRouteBuilderExtensions
|
||||||
|
{
|
||||||
|
public static IEndpointRouteBuilder MapOtOpcUaHubs(this IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
app.MapHub<FleetStatusHub>(FleetStatusHub.Endpoint);
|
||||||
|
app.MapHub<AlertHub>(AlertHub.Endpoint);
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user