Improve admin field names and generation-safe dialog lifecycle

This commit is contained in:
Joseph Doherty
2026-11-13 21:15:58 -05:00
parent 06b1743051
commit 169149f1eb
82 changed files with 15839 additions and 73 deletions
@@ -25,9 +25,9 @@
{
<div class="row g-3 mb-2">
<div class="col-md-6">
<label class="form-label">Driver name</label>
<input class="form-control form-control-sm mono" @bind="_name" placeholder="line3-modbus" />
<div class="form-text">A RawPath segment — letters, digits, dash, underscore.</div>
<TechField Label="Driver name" For="@_nameId" Hint="A RawPath segment — letters, digits, dash, underscore." HintId="@(_nameId + "-hint")">
<input id="@_nameId" class="form-control form-control-sm mono" @bind="_name" placeholder="line3-modbus" aria-describedby="@(_nameId + "-hint")" />
</TechField>
</div>
</div>
@@ -104,6 +104,7 @@
/// <summary>Raised after a successful create/update so the tree can refresh.</summary>
[Parameter] public EventCallback OnSaved { get; set; }
private readonly string _nameId = "driver-name-" + Guid.NewGuid().ToString("N");
private bool _isNew;
private string _driverType = "";
private string _name = "";
@@ -14,12 +14,14 @@
<div style="padding:1rem">
<div class="row g-3">
<div class="col-md-4">
<label class="form-label">Run timeout (ms)</label>
<InputNumber @bind-Value="_form.RunTimeoutMs" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
<div class="form-text">
Per-evaluation deadline for a calculated tag's script. Blank = the driver default (2000 ms).
A script exceeding it is abandoned and the tag publishes Bad.
</div>
<TechField Label="Run timeout (ms)" For="@_timeoutId" HintId="@(_timeoutId + "-hint")"
Hint="Per-evaluation deadline for a calculated tag's script. Blank = the driver default (2000 ms). A script exceeding it is abandoned and the tag publishes Bad.">
<InputNumber id="@_timeoutId" DisplayName="Run timeout" @bind-Value="_form.RunTimeoutMs" @bind-Value:after="EmitAsync" class="form-control form-control-sm"
aria-describedby="@(_timeoutId + "-hint " + _timeoutId + "-error")" />
<div id="@(_timeoutId + "-error")" class="field-error">
@if (_editContext is not null) { <ValidationMessage For="@(() => _form.RunTimeoutMs)" /> }
</div>
</TechField>
</div>
</div>
<p class="form-text mt-3 mb-0">
@@ -32,6 +34,8 @@
<DriverResilienceSection ResilienceConfig="@ResilienceConfig" ResilienceConfigChanged="OnResilienceChanged" />
@code {
[CascadingParameter] private EditContext? _editContext { get; set; }
private readonly string _timeoutId = "calculation-timeout-" + Guid.NewGuid().ToString("N");
/// <summary>The driver-level DriverConfig JSON.</summary>
[Parameter] public string DriverConfigJson { get; set; } = "{}";
/// <summary>Fired (camelCase-serialized) whenever a field changes — enables @bind-DriverConfigJson.</summary>