feat(health): show site event-log/audit write and redaction failures on the Health dashboard (ScadaBridge#88)
New SiteWriteFailureBadges component renders warning badges for SiteEventLogWriteFailures, SiteAuditWriteFailures and AuditRedactionFailure when > 0 on online sites. The CLI 'health summary' already serialises the full latest report, so these counters are visible there unchanged. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
@using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health
|
||||
|
||||
@* Gitea #88: warning badges for the three site-report failure counters that were collected
|
||||
and shipped to central but never rendered — event-log write failures (cumulative since the
|
||||
logger started), audit write failures (per-interval) and audit redaction failures
|
||||
(per-interval). Each renders only when its counter is > 0, like the "Audit rows rejected"
|
||||
badge (#69). Offline sites render nothing: the Offline badge is the signal that matters. *@
|
||||
@if (Report is not null && IsOnline)
|
||||
{
|
||||
@if (Report.SiteEventLogWriteFailures > 0)
|
||||
{
|
||||
<span class="badge bg-warning text-dark"
|
||||
data-test="event-log-write-failures-badge"
|
||||
title="The site failed to write @Report.SiteEventLogWriteFailures event-log row(s) since its logger started (SQLite error, disk full, or queue overflow). Site events are being lost — check the site node's disk and logs.">
|
||||
Event log write failures
|
||||
</span>
|
||||
}
|
||||
@if (Report.SiteAuditWriteFailures > 0)
|
||||
{
|
||||
<span class="badge bg-warning text-dark"
|
||||
data-test="audit-write-failures-badge"
|
||||
title="The site's primary audit writer failed @Report.SiteAuditWriteFailures time(s) in the last report interval; rows were routed to the drop-oldest fallback ring and may be lost. Check the site's audit SQLite store.">
|
||||
Audit write failures
|
||||
</span>
|
||||
}
|
||||
@if (Report.AuditRedactionFailure > 0)
|
||||
{
|
||||
<span class="badge bg-warning text-dark"
|
||||
data-test="audit-redaction-failures-badge"
|
||||
title="The audit payload redactor errored @Report.AuditRedactionFailure time(s) in the last report interval and fields were replaced with a redaction-error marker. Check the audit redaction regex configuration.">
|
||||
Audit redaction failures
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
@code {
|
||||
/// <summary>The site's latest health report, or null when none has arrived yet.</summary>
|
||||
[Parameter] public SiteHealthReport? Report { get; set; }
|
||||
|
||||
/// <summary>Whether the site is currently online; offline sites show no warning badges.</summary>
|
||||
[Parameter] public bool IsOnline { get; set; }
|
||||
}
|
||||
@@ -293,6 +293,7 @@
|
||||
Audit rows rejected
|
||||
</span>
|
||||
}
|
||||
<SiteWriteFailureBadges Report="@state.LatestReport" IsOnline="@state.IsOnline" />
|
||||
@if (!state.IsOnline && state.LastStatusChangeAt is { } changedAt)
|
||||
{
|
||||
<small class="text-muted">offline since @changedAt.ToString("u")</small>
|
||||
|
||||
Reference in New Issue
Block a user