[backend/razor] Display local times when rendering timestamps on queue dashboard pages

This commit is contained in:
Laura Hausmann 2024-07-22 06:23:44 +02:00
parent 1d02ad1073
commit b62a0ad46e
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 7 additions and 7 deletions

View file

@ -177,9 +177,9 @@ else
{ {
Job.JobStatus.Queued => $"for {job.QueueDuration.ToDurationDisplayString()}", Job.JobStatus.Queued => $"for {job.QueueDuration.ToDurationDisplayString()}",
Job.JobStatus.Running => $"for {job.Duration.ToDurationDisplayString()}", Job.JobStatus.Running => $"for {job.Duration.ToDurationDisplayString()}",
Job.JobStatus.Delayed => $"until {job.DelayedUntil?.ToDisplayStringTz() ?? "<unknown>"}", Job.JobStatus.Delayed => $"until {job.DelayedUntil?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>"}",
Job.JobStatus.Completed => $"at {job.FinishedAt?.ToDisplayStringTz() ?? "<unknown>"}", Job.JobStatus.Completed => $"at {job.FinishedAt?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>"}",
Job.JobStatus.Failed => $"at {job.FinishedAt?.ToDisplayStringTz() ?? "<unknown>"}", Job.JobStatus.Failed => $"at {job.FinishedAt?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>"}",
_ => throw new ArgumentOutOfRangeException() _ => throw new ArgumentOutOfRangeException()
}; };

View file

@ -49,13 +49,13 @@
} }
<tr> <tr>
<td>Queued at</td> <td>Queued at</td>
<td>@Model.Job.QueuedAt.ToDisplayStringTz()</td> <td>@Model.Job.QueuedAt.ToLocalTime().ToDisplayStringTz()</td>
</tr> </tr>
@if (Model.Job.Status is not Job.JobStatus.Queued and not Job.JobStatus.Delayed) @if (Model.Job.Status is not Job.JobStatus.Queued and not Job.JobStatus.Delayed)
{ {
<tr> <tr>
<td>Started at</td> <td>Started at</td>
<td>@(Model.Job.StartedAt?.ToDisplayStringTz() ?? "<unknown>")</td> <td>@(Model.Job.StartedAt?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>")</td>
</tr> </tr>
if (Model.Job.WorkerId != null) if (Model.Job.WorkerId != null)
{ {
@ -69,14 +69,14 @@
{ {
<tr> <tr>
<td>Finished at</td> <td>Finished at</td>
<td>@(Model.Job.FinishedAt?.ToDisplayStringTz() ?? "<unknown>")</td> <td>@(Model.Job.FinishedAt?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>")</td>
</tr> </tr>
} }
@if (Model.Job.Status == Job.JobStatus.Delayed) @if (Model.Job.Status == Job.JobStatus.Delayed)
{ {
<tr> <tr>
<td>Delayed until</td> <td>Delayed until</td>
<td>@(Model.Job.DelayedUntil?.ToDisplayStringTz() ?? "<unknown>")</td> <td>@(Model.Job.DelayedUntil?.ToLocalTime().ToDisplayStringTz() ?? "<unknown>")</td>
</tr> </tr>
} }
@if (TimeSpan.FromMilliseconds(Model.Job.Duration).TotalHours <= 72) @if (TimeSpan.FromMilliseconds(Model.Job.Duration).TotalHours <= 72)