Bind script editing and deletion to captured route intent

This commit is contained in:
Joseph Doherty
2026-11-14 01:11:35 -05:00
parent 8929f5f32e
commit 7bd013a57c
70 changed files with 24260 additions and 74 deletions
@@ -0,0 +1,3 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><base href="/"/>
<link rel="stylesheet" href="_content/ZB.MOM.WW.OtOpcUa.AdminUI/lib/bootstrap/css/bootstrap.min.css"/><ThemeHead/><link rel="stylesheet" href="_content/ZB.MOM.WW.OtOpcUa.AdminUI/css/site.css"/>
</head><body><Fixture @rendermode="InteractiveServer"/><script src="_content/ZB.MOM.WW.OtOpcUa.AdminUI/js/dialog-focus.js"></script><script src="_content/ZB.MOM.WW.OtOpcUa.AdminUI/js/monaco-init.js"></script><script src="_framework/blazor.web.js"></script></body></html>
@@ -0,0 +1,27 @@
@page "/"
@implements IDisposable
@page "/scripts"
@inject FixtureSession Session
@inject FixtureRegistry Registry
@inject NavigationManager Nav
<main class="page">
<h1>Local Script Edit acceptance fixture</h1>
<div class="d-flex gap-2 flex-wrap"><button id="alpha" @onclick="ShowAlpha">Alpha</button><button id="beta" @onclick="ShowBeta">Beta</button><button id="new" @onclick="()=>_target=null">New</button><button id="hold" @onclick="()=>Session.HoldNext=true">Hold next synthetic write</button><button id="fail" @onclick="()=>Session.FailNext=true">Fail next synthetic write</button></div>
<output id="session">@Session.Id</output><output id="ready">@(_ready?"ready":"loading")</output>
@if (new Uri(Nav.Uri).AbsolutePath == "/scripts")
{
<p id="returned">Returned to Scripts after committed save.</p>
}
else
{
<AuthorizeView Policy="ConfigEditor"><Authorized><ScriptEdit ScriptId="@_target"/></Authorized></AuthorizeView>
}
</main>
@code{
protected override void OnInitialized()=>Nav.LocationChanged+=OnLocationChanged;
private void OnLocationChanged(object? sender, Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs e)=>_=InvokeAsync(StateHasChanged);
public void Dispose()=>Nav.LocationChanged-=OnLocationChanged;
private void ShowAlpha()=>_target="a";private void ShowBeta()=>_target="b";
private string? _target="a";private bool _ready;
protected override void OnAfterRender(bool firstRender){if(firstRender){Registry.Sessions.TryAdd(Session.Id,Session);_ready=true;StateHasChanged();}}
}
@@ -0,0 +1,6 @@
@using Microsoft.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using ZB.MOM.WW.Theme
@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Pages