feat: initialize manufacturing progress dashboard

This commit is contained in:
czc
2026-07-13 18:07:59 +08:00
commit 658a23b630
87 changed files with 19195 additions and 0 deletions
@@ -0,0 +1,24 @@
using DongfangHydro.Dashboard.Api.Contracts;
using Microsoft.AspNetCore.SignalR;
namespace DongfangHydro.Dashboard.Api.Realtime;
public sealed class SignalRDashboardNotifier(IHubContext<DashboardHub> hubContext)
: IDashboardNotifier
{
public async Task PublishUpdateAsync(
UpdateNodeProgressResultDto update,
DashboardOverviewDto overview,
CancellationToken cancellationToken)
{
var clients = hubContext.Clients.All;
await Task.WhenAll(
clients.SendAsync("nodeUpdated", update.Node, cancellationToken),
clients.SendAsync("orderUpdated", update.Order, cancellationToken),
clients.SendAsync("trendAppended", update.TrendPoint, cancellationToken),
clients.SendAsync("overviewUpdated", overview, cancellationToken),
update.RiskEvent is null
? Task.CompletedTask
: clients.SendAsync("riskEventCreated", update.RiskEvent, cancellationToken));
}
}