UI timezone

This commit is contained in:
2025-12-08 21:42:10 +01:00
parent 1f95d57717
commit e25cdc4441
9 changed files with 100 additions and 9 deletions

View File

@@ -6,6 +6,7 @@
@inject EntityChangeHubService HubService
@inject NavigationManager NavigationManager
@inject ISnackbar Snackbar
@inject DateTimeHelper DateTimeHelper
@implements IDisposable
<MudCard>
@@ -92,14 +93,14 @@
</MudItem>
<MudItem xs="12" md="6">
<MudTextField Value="@job.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss")"
<MudTextField Value="@DateTimeHelper.FormatDateTime(job.CreatedAt)"
Label="Created At"
Variant="Variant.Outlined"
ReadOnly="true"
FullWidth="true"/>
</MudItem>
<MudItem xs="12" md="6">
<MudTextField Value="@(job.LastAttemptAt?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-")"
<MudTextField Value="@DateTimeHelper.FormatDateTime(job.LastAttemptAt)"
Label="Last Attempt At"
Variant="Variant.Outlined"
ReadOnly="true"
@@ -107,7 +108,7 @@
</MudItem>
<MudItem xs="12" md="6">
<MudTextField Value="@(job.CompletedAt?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-")"
<MudTextField Value="@DateTimeHelper.FormatDateTime(job.CompletedAt)"
Label="Completed At"
Variant="Variant.Outlined"
ReadOnly="true"
@@ -161,6 +162,7 @@
protected override async Task OnInitializedAsync()
{
await DateTimeHelper.InitializeAsync();
await LoadJob();
// Subscribe to SignalR entity changes

View File

@@ -111,12 +111,12 @@
</MudTd>
<MudTd DataLabel="Created">
<div @oncontextmenu="@(async (e) => await OnRowRightClick(e, row))" @oncontextmenu:preventDefault="true">
@row.CreatedAt.ToString("yyyy-MM-dd HH:mm")
@DateTimeHelper.FormatDateTime(row.CreatedAt, "yyyy-MM-dd HH:mm")
</div>
</MudTd>
<MudTd DataLabel="Last Attempt">
<div @oncontextmenu="@(async (e) => await OnRowRightClick(e, row))" @oncontextmenu:preventDefault="true">
@(row.LastAttemptAt?.ToString("yyyy-MM-dd HH:mm") ?? "-")
@DateTimeHelper.FormatDateTime(row.LastAttemptAt, "yyyy-MM-dd HH:mm")
</div>
</MudTd>
</RowTemplate>

View File

@@ -15,6 +15,7 @@ public partial class Index : ComponentBase, IDisposable
[Inject] private ISnackbar Snackbar { get; set; } = default!;
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
[Inject] private IJSRuntime JSRuntime { get; set; } = default!;
[Inject] private DateTimeHelper DateTimeHelper { get; set; } = default!;
private PagedResult<QueueJob> jobs = new();
private bool isLoading = false;
@@ -25,6 +26,7 @@ public partial class Index : ComponentBase, IDisposable
protected override async Task OnInitializedAsync()
{
await DateTimeHelper.InitializeAsync();
await LoadJobs();
// Subscribe to SignalR entity changes