17 lines
916 B
Plaintext
17 lines
916 B
Plaintext
@page "/"
|
|
@page "/uns/equipment/{RouteId}"
|
|
@implements IDisposable
|
|
@inject FixtureSession Session
|
|
@inject FixtureRegistry Registry
|
|
<main class="page">
|
|
<p>Local synthetic Equipment caller fixture</p>
|
|
<button id="outside" type="button">Outside fixture control</button><output id="ready">@(_ready?"ready":"loading")</output><output id="session">@Session.Id</output>
|
|
<AuthorizeView Policy="ConfigEditor"><Authorized><EquipmentPage EquipmentId="@Session.Target"/></Authorized><NotAuthorized><p>Access denied.</p></NotAuthorized></AuthorizeView>
|
|
</main>
|
|
@code{
|
|
[Parameter]public string? RouteId{get;set;}
|
|
private bool _ready;
|
|
protected override void OnAfterRender(bool firstRender){if(firstRender){Registry.Sessions.TryAdd(Session.Id,Session);Session.Changed=()=>InvokeAsync(StateHasChanged);_ready=true;StateHasChanged();}}
|
|
public void Dispose(){Session.Changed=null;Registry.Sessions.TryRemove(Session.Id,out _);}
|
|
}
|