}
@* Audit Log (#23) M7 Bundle E — three KPI tiles for the Audit channel
(volume / error rate / backlog). Refreshed alongside the site states. *@
@if (_siteStates.Count == 0)
{
No site health reports received yet.
}
else
{
@* Overview cards *@
@_siteStates.Values.Count(s => s.IsOnline)
Sites Online
@_siteStates.Values.Count(s => !s.IsOnline)
Sites Offline
@_siteStates.Values.Count(SiteHasActiveErrors)
Sites with active errors
@* Per-site detail cards — central cluster pinned to the top, then sites alphabetically *@
@foreach (var (siteId, state) in _siteStates.OrderBy(s => s.Key == CentralHealthReportLoop.CentralSiteId ? 0 : 1).ThenBy(s => s.Key))
{
var isCentral = siteId == CentralHealthReportLoop.CentralSiteId;
var siteName = isCentral ? "Central Cluster" : GetSiteName(siteId);
var detailsCollapseId = $"site-details-{siteId}";