Files
lmxopcua/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Drivers/DriverIdentitySection.razor
T
Joseph Doherty 0b4b2e4cfd refactor(historian-gateway): retire Wonderware historian projects (gateway is sole backend)
The HistorianGateway driver is now the sole historian read/write+alarm backend, so the
Wonderware sidecar projects are dead code. Removes the 5 Wonderware projects (driver,
.Client, .Client.Contracts, + their 2 test projects) from the solution and tree, and fully
retires the vestigial 'Historian.Wonderware' driver type (UI/probe-only; it had no driver
factory): the Host probe registration, the AdminUI driver-config surface (driver page,
tag-config editor/model/validator entry, address picker/builder, driver-type catalog +
dropdown + edit-router entries), and their tests. Prunes the now-unused Wonderware
connection fields (Host/Port/UseTls/ServerCertThumbprint/SharedSecret) from
AlarmHistorianOptions (keeping Enabled + the SQLite store-and-forward knobs) and refreshes
the stale XML docs that named Wonderware as the production backend.

Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii
2026-06-26 19:25:21 -04:00

80 lines
4.0 KiB
Plaintext

@* Identity section shared by the typed driver pages. The parent page owns the <EditForm> and all
data loading/persistence — this component is purely a section of inputs. *@
@using System.ComponentModel.DataAnnotations
@using ZB.MOM.WW.OtOpcUa.Configuration.Entities
<section class="panel rise" style="animation-delay:.02s">
<div class="panel-head">@(IsNew ? "Identity" : $"Edit {Model.DriverInstanceId}")</div>
<div style="padding:1rem">
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label" for="instId">DriverInstanceId</label>
<InputText id="instId" @bind-Value="Model.DriverInstanceId" disabled="@(!IsNew)"
class="form-control form-control-sm mono"
placeholder="drv-modbus-line3-01" />
<ValidationMessage For="@(() => Model.DriverInstanceId)" />
</div>
<div class="col-md-6 mb-3">
<label class="form-label" for="name">Display name</label>
<InputText id="name" @bind-Value="Model.Name" class="form-control form-control-sm"
placeholder="Line 3 Modbus" />
<ValidationMessage For="@(() => Model.Name)" />
</div>
</div>
<div class="row">
@if (ShowDriverType)
{
<div class="col-md-6 mb-3">
<label class="form-label" for="dtype">Driver type</label>
<InputSelect id="dtype" @bind-Value="Model.DriverType" disabled="@(!IsNew)"
class="form-select form-select-sm">
<option value="Modbus">Modbus TCP</option>
<option value="AbCip">AbCip</option>
<option value="AbLegacy">AbLegacy</option>
<option value="S7">S7</option>
<option value="TwinCat">TwinCat</option>
<option value="Focas">Focas</option>
<option value="OpcUaClient">OpcUaClient</option>
<option value="GalaxyMxGateway">Galaxy</option>
</InputSelect>
<div class="form-text">Cannot be changed after creation — drives the actor type that owns this instance.</div>
</div>
}
<div class="col-md-6 mb-3">
<label class="form-label" for="ns">Namespace</label>
<InputSelect id="ns" @bind-Value="Model.NamespaceId" class="form-select form-select-sm">
@foreach (var ns in Namespaces)
{
<option value="@ns.NamespaceId">@ns.NamespaceId (@ns.Kind)</option>
}
</InputSelect>
<ValidationMessage For="@(() => Model.NamespaceId)" />
</div>
</div>
<div class="mb-3">
<label class="form-label" for="enabled">Enabled</label>
<div class="form-check form-switch">
<InputCheckbox id="enabled" @bind-Value="Model.Enabled" class="form-check-input" />
<label class="form-check-label" for="enabled">Spawn this driver in deployments</label>
</div>
</div>
</div>
</section>
@code {
[Parameter, EditorRequired] public DriverIdentityModel Model { get; set; } = new();
[Parameter, EditorRequired] public IReadOnlyList<Namespace> Namespaces { get; set; } = [];
[Parameter] public bool IsNew { get; set; }
[Parameter] public bool ShowDriverType { get; set; }
public sealed class DriverIdentityModel
{
[Required, RegularExpression("^[A-Za-z0-9_-]+$", ErrorMessage = "Use letters, digits, dash, underscore.")]
public string DriverInstanceId { get; set; } = "";
[Required] public string Name { get; set; } = "";
[Required] public string DriverType { get; set; } = "Modbus";
[Required] public string NamespaceId { get; set; } = "";
public bool Enabled { get; set; } = true;
}
}