[backend/razor] Improve exception details view in queue dashboard

This commit is contained in:
Laura Hausmann 2024-06-21 19:45:47 +02:00
parent 3599150603
commit 5f6603f044
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 23 additions and 2 deletions

View file

@ -101,9 +101,26 @@
@if (Model.Job is { StackTrace: not null, Exception: null }) @if (Model.Job is { StackTrace: not null, Exception: null })
{ {
<tr> <tr>
<td>Exception stack trace</td>
<td> <td>
<pre><code>@Model.Job.StackTrace</code></pre> Exception stack trace
<br/>
<button onclick="copyElementToClipboard('exceptionStackTrace')">Copy to clipboard</button>
</td>
<td>
<pre><code id="exceptionStackTrace">@Model.Job.StackTrace</code></pre>
</td>
</tr>
}
@if (Model.Job.Exception != null)
{
<tr>
<td>
Exception details
<br/>
<button onclick="copyElementToClipboard('exceptionDetails')">Copy to clipboard</button>
</td>
<td>
<pre><code id="exceptionDetails">@Model.Job.Exception</code></pre>
</td> </td>
</tr> </tr>
} }

View file

@ -21,3 +21,7 @@ function navigate(target) {
async function copyToClipboard(text) { async function copyToClipboard(text) {
await navigator.clipboard.writeText(text); await navigator.clipboard.writeText(text);
} }
async function copyElementToClipboard(id) {
await copyToClipboard(document.getElementById(id).textContent);
}