Files
mxaccessgw/docs/ui-validation/host/Components/FaultIdentityFixture.razor
T
Joseph Doherty 26a90883fa
ci / java (push) Failing after 15m11s
ci / nightly-windev (push) Failing after 10m18s
ci / portable (push) Failing after 27m42s
ci / windows-x86 (push) Failing after 22m19s
Unify gateway styling and preserve identity through recovery
2026-11-13 20:12:00 -05:00

21 lines
1.2 KiB
Plaintext

@namespace MxUiCanary.Components
@using ZB.MOM.WW.MxGateway.Server.Dashboard
@page "/fault-identity-fixture"
@implements IDisposable
@inject IJSRuntime JS
<ThemeShell Product="Synthetic fault identity"><ChildContent>
<h1>Fault identity fixture</h1>
<button type="button" class="btn btn-primary" @onclick="ArmAsync">Arm synthetic next snapshot</button>
<p role="status">Snapshot @_round</p>
<section data-fault-mode="compact"><FaultList Faults="_faults" Compact="true" /></section>
<section data-fault-mode="table"><FaultList Faults="_faults" /></section>
</ChildContent></ThemeShell>
@code {
private int _round;private bool _disposed;
private IReadOnlyList<DashboardFaultSummary> _faults=[Fault("session-a"),Fault("session-b")];
private static DashboardFaultSummary Fault(string id)=>new("Worker",id,123,"Faulted","Synthetic fault for "+id+" "+new string('x',300),DateTimeOffset.UnixEpoch);
private async Task ArmAsync(){await Task.Delay(1200);if(_disposed)return;_round++;_faults=[Fault("session-c"),Fault("session-b"),Fault("session-a") with{ObservedAt=DateTimeOffset.UnixEpoch.AddMinutes(1)}];}
protected override async Task OnAfterRenderAsync(bool firstRender){if(firstRender)await JS.InvokeVoidAsync("mxCanaryReady");}
public void Dispose()=>_disposed=true;
}