Files
lmxopcua/docs/ui-consistency/ot13-raw-workflows/canary/Components/Pilot.razor
T
2026-11-14 00:19:09 -05:00

30 lines
1.5 KiB
Plaintext

@page "/"
@rendermode InteractiveServer
@inject WorkflowState State
@implements IDisposable
<ThemeShell Product="Raw workflow fixture">
<main class="p-3">
<h1>Raw workflow fixture</h1><p>Local synthetic callbacks; no real tag, broker, driver or database operations.</p>
<output id="open-requests">@State.OpenRequests</output><output id="closed-sessions">@State.ClosedSessions</output>
<output id="rebirth-requests">@State.RebirthRequests</output>
<output id="ready">@_ready</output><output id="requests">@State.Requests</output><output id="saved">@_saved</output>
<button id="open" class="btn btn-primary" @onclick="() => _visible=true">Add synthetic tags</button>
@if(Kind=="browse" || Kind=="rebirth")
{
<RawBrowseModal @bind-Visible="_visible" DeviceId="synthetic-device" DriverType="@State.DriverType" OnSaved="() => _saved++" />
}
else
{
<RawManualTagEntryModal @bind-Visible="_visible" DeviceId="synthetic-device" DriverType='@(Kind=="typed" ? "S7" : "Unmapped")' OnSaved="() => _saved++" />
}
</main>
</ThemeShell>
@code {
[SupplyParameterFromQuery(Name="kind")]public string? Kind{get;set;}
protected override void OnInitialized(){State.DriverType=Kind=="rebirth"?"Mqtt":"AbCip";State.Changed+=OnFixtureChanged;}
private void OnFixtureChanged()=>_=InvokeAsync(StateHasChanged);
public void Dispose()=>State.Changed-=OnFixtureChanged;
private bool _visible,_ready;private int _saved;
protected override void OnAfterRender(bool firstRender){if(firstRender){_ready=true;StateHasChanged();}}
}