Expose complete diagnostic text through native disclosures
This commit is contained in:
@@ -56,7 +56,7 @@ else
|
||||
<div class="kv"><span class="k">Last success</span><span class="v">@(_status.LastSuccessUtc?.ToString("u") ?? "—")</span></div>
|
||||
@if (!string.IsNullOrWhiteSpace(_status.LastError))
|
||||
{
|
||||
<div class="kv"><span class="k">Last error</span><span class="v text-danger small" title="@_status.LastError">@DisplayText.Abbreviate(_status.LastError, 80)</span></div>
|
||||
<div class="kv"><span class="k">Last error</span><div class="v small"><DiagnosticDetails Summary="@(DisplayText.Abbreviate(_status.LastError, 80))" Text="@_status.LastError" /></div></div>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -54,11 +54,8 @@ else
|
||||
<td>@a.Principal</td>
|
||||
<td><span class="chip chip-idle">@a.EventType</span></td>
|
||||
<td><span class="mono small">@(a.NodeId ?? "—")</span></td>
|
||||
<td><span class="mono small">@(a.CorrelationId?.ToString("N")[..8] ?? "—")</span></td>
|
||||
<td class="text-muted small" title="@(a.DetailsJson ?? "")"
|
||||
style="max-width:400px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">
|
||||
@(a.DetailsJson ?? "")
|
||||
</td>
|
||||
<td><span class="mono small">@(a.CorrelationId?.ToString("D") ?? "—")</span></td>
|
||||
<td class="small"><DiagnosticDetails Summary="Audit details" Text="@a.DetailsJson" /></td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -72,7 +72,10 @@
|
||||
<th scope="row"><code>@Short(d.DeploymentId)</code></th>
|
||||
<td><code>@DisplayText.Abbreviate(d.RevisionHash, 12)</code></td>
|
||||
@* #601: Sealed + a reason = sealed with a degraded address-space apply on some node(s). *@
|
||||
<td title="@(d.FailureReason ?? "")">@(d.Status == DeploymentStatus.Sealed && !string.IsNullOrEmpty(d.FailureReason) ? "Sealed (degraded)" : d.Status.ToString())</td>
|
||||
<td>
|
||||
@(d.Status == DeploymentStatus.Sealed && !string.IsNullOrEmpty(d.FailureReason) ? "Sealed (degraded)" : d.Status.ToString())
|
||||
@if (!string.IsNullOrEmpty(d.FailureReason)) { <DiagnosticDetails Summary="Failure reason" Text="@d.FailureReason" /> }
|
||||
</td>
|
||||
<td>@d.CreatedBy</td>
|
||||
<td>@d.CreatedAtUtc.ToString("u")</td>
|
||||
<td>@(d.SealedAtUtc?.ToString("u") ?? "—")</td>
|
||||
|
||||
@@ -101,7 +101,7 @@ else
|
||||
<td><span class="chip @StatusChipClass(r.Status, r.FailureReason)">@StatusLabel(r.Status, r.FailureReason)</span></td>
|
||||
<td>@(r.AppliedAtUtc?.ToString("u") ?? "—")</td>
|
||||
<td>@(r.StartedAtUtc?.ToString("u") ?? "—")</td>
|
||||
<td title="@(r.FailureReason ?? "")">@(string.IsNullOrEmpty(r.FailureReason) ? "" : DisplayText.Abbreviate(r.FailureReason, 80))</td>
|
||||
<td>@if (!string.IsNullOrEmpty(r.FailureReason)) { <DiagnosticDetails Summary="@(DisplayText.Abbreviate(r.FailureReason, 80))" Text="@r.FailureReason" /> }</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
<PageErrorBoundary>
|
||||
<PageTitle>Script log · OtOpcUa</PageTitle>
|
||||
<div class="d-flex flex-wrap gap-2 justify-content-between align-items-center mb-3">
|
||||
<div class="page-head">
|
||||
<h1>Script log</h1>
|
||||
<span class="spacer"></span>
|
||||
<div class="d-flex flex-wrap align-items-end gap-2" style="max-width:100%;min-width:0">
|
||||
<div class="ot-toolbar d-flex flex-wrap align-items-end gap-2" style="max-width:100%;min-width:0">
|
||||
<div><label class="form-label small mb-1" for="@(_filterScope + "-level")">Log level</label>
|
||||
<select id="@(_filterScope + "-level")" class="form-select form-select-sm" style="width:auto" @bind="_levelFilter" @bind:after="RecomputeVisible">
|
||||
<option value="">All levels</option>
|
||||
@@ -66,7 +66,7 @@ else
|
||||
@foreach (var e in _visible)
|
||||
{
|
||||
<tr>
|
||||
<td><span class="mono small">@e.TimestampUtc.ToString("HH:mm:ss.fff")</span></td>
|
||||
<td><span class="mono small">@e.TimestampUtc.ToString("yyyy-MM-dd HH:mm:ss.fff 'UTC'")</span></td>
|
||||
<td><span class="chip @LevelChipClass(e.Level)">@e.Level</span></td>
|
||||
<td><span class="mono small">@e.ScriptId</span></td>
|
||||
<td class="text-muted small">
|
||||
@@ -74,7 +74,7 @@ else
|
||||
@if (!string.IsNullOrEmpty(e.AlarmId)) { <span class="ms-1">alarm=@e.AlarmId</span> }
|
||||
@if (!string.IsNullOrEmpty(e.EquipmentId)) { <span class="ms-1">eq=@e.EquipmentId</span> }
|
||||
</td>
|
||||
<td title="@e.Message"><span class="mono small">@DisplayText.Abbreviate(e.Message, 120)</span></td>
|
||||
<td><DiagnosticDetails Summary="@(DisplayText.Abbreviate(e.Message, 120))" Text="@e.Message" /></td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
@if (string.IsNullOrEmpty(Text))
|
||||
{
|
||||
<span class="text-muted small">No detail recorded.</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<details class="diagnostic-details">
|
||||
<summary>@Summary</summary>
|
||||
<pre class="mono small" role="region" tabindex="0" aria-label="@Summary">@Text</pre>
|
||||
</details>
|
||||
}
|
||||
|
||||
@code {
|
||||
/// <summary>The domain-specific label for this native disclosure and its full diagnostic text.</summary>
|
||||
[Parameter] public string Summary { get; set; } = "Full details";
|
||||
|
||||
/// <summary>Complete diagnostic text rendered as escaped text, never executable markup.</summary>
|
||||
[Parameter] public string? Text { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.diagnostic-details { min-width: 0; max-width: 100%; }
|
||||
.diagnostic-details summary { overflow-wrap: anywhere; cursor: pointer; color: var(--accent-deep); text-decoration: underline; text-underline-offset: .16em; }
|
||||
.diagnostic-details pre { margin: .5rem 0 0; padding: .5rem; color: var(--ink); background: var(--zebra-bg); max-width: 100%; max-height: 18rem; overflow: auto; text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
+8
-9
@@ -46,7 +46,7 @@
|
||||
}
|
||||
else if (_error is not null)
|
||||
{
|
||||
<p class="mb-0" style="color:var(--bad)" title="@_error">SignalR error: @DisplayText.Abbreviate(_error, 60)</p>
|
||||
<DiagnosticDetails Summary="@($"Status read error: {DisplayText.Abbreviate(_error, 60)}")" Text="@_error" />
|
||||
}
|
||||
else if (nodes.Count == 0)
|
||||
{
|
||||
@@ -87,10 +87,7 @@
|
||||
|
||||
@if (snap.LastError is { Length: > 0 } lastError)
|
||||
{
|
||||
<details class="mt-2" style="font-size:0.85rem">
|
||||
<summary style="cursor:pointer; color:var(--ink-soft)">Last error</summary>
|
||||
<pre class="mt-1 mb-0" style="white-space:pre-wrap; word-break:break-word; color:var(--bad); font-size:0.8rem">@lastError</pre>
|
||||
</details>
|
||||
<div class="mt-2"><DiagnosticDetails Summary="@($"Last error · {n.Label}")" Text="@lastError" /></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -188,7 +185,11 @@
|
||||
|
||||
@if (_opResultMessage is not null)
|
||||
{
|
||||
<span class="chip @(_opResultOk ? "chip-ok" : "chip-bad")" style="font-size:0.8rem" title="@_opResultMessageFull">@_opResultMessage</span>
|
||||
<span class="chip @(_opResultOk ? "chip-ok" : "chip-bad")" style="font-size:0.8rem">@_opResultMessage</span>
|
||||
@if (!string.Equals(_opResultMessage, _opResultMessageFull, StringComparison.Ordinal))
|
||||
{
|
||||
<DiagnosticDetails Summary="Operation details" Text="@_opResultMessageFull" />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -235,9 +236,7 @@
|
||||
private bool _busyReconnect;
|
||||
private bool _busyRestart;
|
||||
private bool _showRestartConfirm;
|
||||
// Display text for the op-result chip (truncated at the ShowOpResult choke point) plus the
|
||||
// untruncated original, which rides the chip's title attribute so the full message stays
|
||||
// reachable on hover.
|
||||
// Keep the outcome chip compact; complete metadata is available in a native disclosure.
|
||||
private string? _opResultMessage;
|
||||
private string? _opResultMessageFull;
|
||||
private bool _opResultOk;
|
||||
|
||||
Reference in New Issue
Block a user