86 lines
3.9 KiB
Plaintext
86 lines
3.9 KiB
Plaintext
@if (Faults.Count == 0)
|
|
{
|
|
<div class="empty-state">No fault records in this snapshot.</div>
|
|
}
|
|
else if (Compact)
|
|
{
|
|
<div class="fault-summaries">
|
|
@foreach (DashboardFaultSummary fault in Faults)
|
|
{
|
|
<article @key="(fault.SessionId, fault.Source, fault.WorkerProcessId, fault.Message)" class="fault-summary">
|
|
<div class="d-flex gap-2 flex-wrap align-items-center"><strong>@fault.Source</strong><StatusBadge Text="@fault.State" /></div>
|
|
@if (fault.Message.Length > 160)
|
|
{
|
|
<details class="fault-diagnostic">
|
|
<summary>@DashboardDisplay.Abbreviate(fault.Message)</summary>
|
|
<pre tabindex="0" role="region" aria-label="@($"Full fault diagnostic for {fault.Source}, session {fault.SessionId ?? "unassigned"}")">@fault.Message</pre>
|
|
</details>
|
|
}
|
|
else { <p class="mb-1">@fault.Message</p> }
|
|
<div class="fault-context">
|
|
<span>Observed @DashboardDisplay.DateTime(fault.ObservedAt)</span>
|
|
<span>Session
|
|
@if (!string.IsNullOrWhiteSpace(fault.SessionId))
|
|
{ <a href="@($"sessions/{Uri.EscapeDataString(fault.SessionId)}")"><code>@fault.SessionId</code></a> }
|
|
else { <code>@DashboardDisplay.Text(fault.SessionId)</code> }
|
|
</span>
|
|
<span>Worker @(fault.WorkerProcessId?.ToString(System.Globalization.CultureInfo.InvariantCulture) ?? "-")</span>
|
|
</div>
|
|
</article>
|
|
}
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="table-responsive">
|
|
<table class="table table-sm align-middle dashboard-table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Observed</th>
|
|
<th scope="col">Source</th>
|
|
<th scope="col">Session</th>
|
|
<th scope="col">Worker</th>
|
|
<th scope="col">State</th>
|
|
<th scope="col">Message</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (DashboardFaultSummary fault in Faults)
|
|
{
|
|
<tr @key="(fault.SessionId, fault.Source, fault.WorkerProcessId, fault.Message)">
|
|
<td>@DashboardDisplay.DateTime(fault.ObservedAt)</td>
|
|
<td>@fault.Source</td>
|
|
<td>
|
|
@if (!string.IsNullOrWhiteSpace(fault.SessionId))
|
|
{
|
|
<a href="@($"sessions/{Uri.EscapeDataString(fault.SessionId)}")"><code>@fault.SessionId</code></a>
|
|
}
|
|
else { <code>@DashboardDisplay.Text(fault.SessionId)</code> }
|
|
</td>
|
|
<td>@(fault.WorkerProcessId?.ToString(System.Globalization.CultureInfo.InvariantCulture) ?? "-")</td>
|
|
<td><StatusBadge Text="@fault.State" /></td>
|
|
<td>
|
|
@if (fault.Message.Length > 160)
|
|
{
|
|
<details class="fault-diagnostic">
|
|
<summary>@DashboardDisplay.Abbreviate(fault.Message)</summary>
|
|
<pre tabindex="0" role="region" aria-label="@($"Full fault diagnostic for {fault.Source}, session {fault.SessionId ?? "unassigned"}")">@fault.Message</pre>
|
|
</details>
|
|
}
|
|
else { @fault.Message }
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
[Parameter]
|
|
public bool Compact { get; set; }
|
|
|
|
[Parameter]
|
|
public IReadOnlyList<DashboardFaultSummary> Faults { get; set; } = [];
|
|
}
|