615b487a77
Adds missing <summary>/<param> XML docs across 99 server, worker, and test files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the analyzer clean). Bundles in WIP dashboard work: NavSection extraction, MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
25 lines
1006 B
C#
25 lines
1006 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace ZB.MOM.WW.MxGateway.Server.Dashboard.Hubs;
|
|
|
|
/// <summary>
|
|
/// SignalR hub that pushes a fresh <see cref="DashboardSnapshot"/> on every
|
|
/// snapshot refresh. New connections receive the current snapshot
|
|
/// immediately via <see cref="OnConnectedAsync"/>; subsequent refreshes are
|
|
/// broadcast by <see cref="DashboardSnapshotPublisher"/>.
|
|
/// </summary>
|
|
[Authorize(Policy = DashboardAuthenticationDefaults.HubClientsPolicy)]
|
|
public sealed class DashboardSnapshotHub(IDashboardSnapshotService snapshotService) : Hub
|
|
{
|
|
/// <summary>Method name used to push snapshot updates to clients.</summary>
|
|
public const string SnapshotMessage = "SnapshotUpdated";
|
|
|
|
/// <inheritdoc />
|
|
public override async Task OnConnectedAsync()
|
|
{
|
|
await Clients.Caller.SendAsync(SnapshotMessage, snapshotService.GetSnapshot()).ConfigureAwait(false);
|
|
await base.OnConnectedAsync().ConfigureAwait(false);
|
|
}
|
|
}
|