feat(m9/T25): connection live-status indicators on the design page

This commit is contained in:
Joseph Doherty
2026-06-18 11:03:22 -04:00
parent e3bc19c673
commit efe3ada03d
6 changed files with 393 additions and 0 deletions
@@ -0,0 +1,27 @@
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <summary>
/// M9-T25: CentralUI facade that projects the per-site health reports' name-keyed
/// connection statuses onto a connection-id → <see cref="ConnectionHealth"/> map for
/// the design DataConnections page. Reuses the existing health transport — the
/// <see cref="ZB.MOM.WW.ScadaBridge.HealthMonitoring.ICentralHealthAggregator"/>'s
/// already-aggregated <c>SiteHealthReport.DataConnectionStatuses</c> — and resolves
/// each report's connection NAME key back to a <c>DataConnection.Id</c> within the
/// report's own site, so the page can render a live badge per connection node.
/// </summary>
public interface IConnectionHealthQueryService
{
/// <summary>
/// Returns a snapshot of connection-id → latest known <see cref="ConnectionHealth"/>
/// across every configured site. A site with no health report yet (or a
/// heartbeat-only state) contributes no entries; a report referencing a
/// connection name that does not match any configured connection is skipped.
/// Callers treat a missing key as "unknown" rather than a failure.
/// </summary>
/// <param name="ct">Cancellation token.</param>
/// <returns>A task resolving to the connection-id → health map.</returns>
Task<IReadOnlyDictionary<int, ConnectionHealth>> GetConnectionHealthAsync(
CancellationToken ct = default);
}