fix(admin-ui): associate native device endpoint fields

This commit is contained in:
Joseph Doherty
2026-11-13 20:49:26 -05:00
parent 7b7fdf0eb7
commit 7e57074653
39 changed files with 3063 additions and 44 deletions
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><base href="/" /><title>Local device field fixture</title>
<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><Router AppAssembly="typeof(App).Assembly"><Found Context="route"><RouteView RouteData="route" /></Found></Router><script src="_framework/blazor.web.js"></script></body></html>
@@ -0,0 +1,28 @@
@page "/"
@rendermode InteractiveServer
<main class="container-fluid p-3"><h1>Device field accessibility fixture</h1><p>Synthetic local drafts only. No backend services or connection actions.</p>
<button @onclick="() => _changes++">Verify local interactivity</button><output id="changes">@_changes</output><output id="interactive">@_ready</output>
<EditForm EditContext="_context" OnSubmit="IgnoreSubmit">
@foreach (var type in Types)
{
@for (int copy = 0; copy < 2; copy++)
{
var key = type.Name + copy;
<section data-device="@type.Name" data-copy="@copy" @key="key"><h2>@type.Name · instance @copy</h2><DynamicComponent Type="type" Parameters="Values(type, key)" /></section>
}
}
</EditForm></main>
@code {
private readonly EditContext _context = new(new object());
private readonly Dictionary<string, string> _values = new();
private int _changes;
private bool _ready;
protected override void OnAfterRender(bool firstRender) { if (firstRender) { _ready = true; StateHasChanged(); } }
private static readonly Type[] Types = [typeof(AbCipDeviceForm), typeof(AbLegacyDeviceForm), typeof(FocasDeviceForm), typeof(HeidenhainDeviceForm), typeof(ModbusDeviceForm), typeof(OpcUaClientDeviceForm), typeof(S7DeviceForm), typeof(TwinCATDeviceForm)];
private Dictionary<string, object> Values(Type type, string key) => new()
{
["DeviceConfigJson"] = _values.GetValueOrDefault(key, "{}"),
["DeviceConfigJsonChanged"] = EventCallback.Factory.Create<string>(this, value => { _values[key] = value; _changes++; })
};
private void IgnoreSubmit(EditContext context) { }
}
@@ -0,0 +1,7 @@
@using Microsoft.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using ZB.MOM.WW.Theme
@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.DeviceForms