feat(kpi): K15 — Audit Log trend charts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
@page "/audit/log"
|
||||
@attribute [Authorize(Policy = AuthorizationPolicies.OperationalAudit)]
|
||||
@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit
|
||||
@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared
|
||||
@using ZB.MOM.WW.ScadaBridge.CentralUI.Services
|
||||
@using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit
|
||||
@using ZB.MOM.WW.ScadaBridge.Security
|
||||
@@ -11,6 +12,56 @@
|
||||
<div class="container-fluid mt-3">
|
||||
<h1 class="h4 mb-3">Audit Log</h1>
|
||||
|
||||
@* Trends panel (M6 / K15). A best-effort collapsible Bootstrap card sitting
|
||||
above the audit query UI: one KpiTrendChart per AuditLog global metric over
|
||||
a 24h (default) / 7d window. Series are fetched independently in the
|
||||
code-behind — a failed fetch degrades only that chart to the unavailable
|
||||
placeholder and never breaks the filter bar / grid below. *@
|
||||
<div class="card mb-3" data-test="audit-trends">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<button type="button"
|
||||
class="btn btn-link p-0 text-decoration-none fw-semibold"
|
||||
aria-expanded="@_trendsOpen"
|
||||
@onclick="ToggleTrendsAsync">
|
||||
Trends
|
||||
<span class="text-muted small">@(_trendsOpen ? "▾" : "▸")</span>
|
||||
</button>
|
||||
@if (_trendsOpen)
|
||||
{
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Trend window">
|
||||
<button type="button"
|
||||
class="btn @(_windowHours == 24 ? "btn-secondary" : "btn-outline-secondary")"
|
||||
@onclick="() => SetWindowAsync(24)">
|
||||
24h
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn @(_windowHours == 168 ? "btn-secondary" : "btn-outline-secondary")"
|
||||
@onclick="() => SetWindowAsync(168)">
|
||||
7d
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (_trendsOpen)
|
||||
{
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach (var (metric, title, unit) in TrendMetrics)
|
||||
{
|
||||
var series = SeriesFor(metric);
|
||||
<div class="col-12 col-md-4">
|
||||
<KpiTrendChart Points="@series.Points"
|
||||
Title="@title"
|
||||
Unit="@unit"
|
||||
IsAvailable="@series.IsAvailable"
|
||||
ErrorMessage="@series.ErrorMessage" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@* Filter bar (Bundle B / M7-T2). Apply hands the collapsed filter to the grid.
|
||||
Bundle D (M7-T10..T12) threads a query-string instance prefill through
|
||||
InitialInstanceSearch — UI-only because the filter contract has no instance column. *@
|
||||
|
||||
Reference in New Issue
Block a user