This commit is contained in:
2026-06-28 13:58:35 +03:00
parent 8f45028715
commit e6bf8258bb
114 changed files with 4365 additions and 874 deletions
@@ -0,0 +1,54 @@
@code {
[Parameter] public IReadOnlyList<ReplayEvent> Events { get; set; } = [];
[Parameter] public int MaxRows { get; set; } = 200;
private string GetBadgeClass(ReplayEventType type) => type switch
{
ReplayEventType.Decision => "badge-decision",
ReplayEventType.StateChange => "badge-statechange",
ReplayEventType.Warning => "badge-warning",
ReplayEventType.Anomaly => "badge-anomaly",
ReplayEventType.ServiceCall => "badge-servicecall",
_ => "badge-info"
};
}
@if (Events.Count == 0)
{
<div class="text-muted text-center py-4">No events recorded for this monitor.</div>
}
else
{
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-sm table-hover align-middle mb-0">
<thead class="sticky-top" style="background-color: #2b3035;">
<tr>
<th style="width: 100px;">Time</th>
<th style="width: 100px;">Type</th>
<th>Message</th>
<th>Details</th>
</tr>
</thead>
<tbody>
@foreach (var evt in Events.Take(MaxRows))
{
<tr>
<td class="text-nowrap font-monospace small">
@evt.Timestamp.ToLocalTime().ToString("HH:mm:ss")
</td>
<td>
<span class="badge @GetBadgeClass(evt.EventType)">@evt.EventType</span>
</td>
<td class="small">@evt.Message</td>
<td class="text-muted small">@evt.Details</td>
</tr>
}
</tbody>
</table>
</div>
@if (Events.Count > MaxRows)
{
<div class="text-muted small mt-1">Showing @MaxRows of @Events.Count events</div>
}
}
@@ -0,0 +1,53 @@
@code {
[Parameter] public ReplayTimeline? Timeline { get; set; }
private IReadOnlyList<ReplayEvent> AllEvents => Timeline?.GetAllEvents() ?? [];
private int TotalEvents => AllEvents.Count;
private int Decisions => AllEvents.Count(e => e.EventType == ReplayEventType.Decision);
private int ServiceCalls => AllEvents.Count(e => e.EventType == ReplayEventType.ServiceCall);
private int Warnings => AllEvents.Count(e => e.EventType == ReplayEventType.Warning);
private int Anomalies => AllEvents.Count(e => e.EventType == ReplayEventType.Anomaly);
}
<div class="row g-3 mb-4">
<div class="col">
<div class="card stat-card">
<div class="card-body">
<div class="display-6">@TotalEvents</div>
<div class="text-muted small">Total Events</div>
</div>
</div>
</div>
<div class="col">
<div class="card stat-card border-success">
<div class="card-body">
<div class="display-6 text-success">@Decisions</div>
<div class="text-muted small">Decisions</div>
</div>
</div>
</div>
<div class="col">
<div class="card stat-card border-info">
<div class="card-body">
<div class="display-6 text-info">@ServiceCalls</div>
<div class="text-muted small">Service Calls</div>
</div>
</div>
</div>
<div class="col">
<div class="card stat-card border-warning">
<div class="card-body">
<div class="display-6 text-warning">@Warnings</div>
<div class="text-muted small">Warnings</div>
</div>
</div>
</div>
<div class="col">
<div class="card stat-card border-danger">
<div class="card-body">
<div class="display-6 text-danger">@Anomalies</div>
<div class="text-muted small">Anomalies</div>
</div>
</div>
</div>
</div>