@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers
Resilience overrides (optional)

Blank fields use the driver type's stability-tier defaults (see docs/v2/driver-stability.md). Set only what you need to override.

@if (_m.ParseFailed) { }
@foreach (var cap in ResilienceFormModel.Capabilities) { var row = _m.Policies[cap]; var writeShaped = cap is "Write" or "AlarmAcknowledge"; }
CapabilityTimeout (s)RetriesBreaker threshold
@cap
@{ var _warnings = _m.Validate(); } @if (_warnings.Count > 0) { }
Raw JSON (advanced) @* Render the bound STORED value, not the re-serialized model — shows the truth in both the healthy and the malformed case. *@
@(ResilienceConfig ?? "(null — all tier defaults)")
@code { [Parameter] public string? ResilienceConfig { get; set; } [Parameter] public EventCallback ResilienceConfigChanged { get; set; } private ResilienceFormModel _m = new(); private string? _lastParsed; protected override void OnParametersSet() { // Re-parse only when the inbound value actually changed (avoid clobbering edits on re-render). if (!string.Equals(_lastParsed, ResilienceConfig, StringComparison.Ordinal)) { _m = ResilienceFormModel.FromJson(ResilienceConfig); _lastParsed = ResilienceConfig; } } private async Task EmitAsync() { // Never emit while the stored config is unparseable — the section is locked, and an unrelated // keystroke must never silently overwrite what we couldn't read (04/C-7). if (_m.ParseFailed) return; var json = _m.ToJson(); _lastParsed = json; ResilienceConfig = json; await ResilienceConfigChanged.InvokeAsync(json); } private async Task DiscardAsync() { // Explicit, visible destruction — replace the unparseable blob with a blank (tier-default) config. _m = new ResilienceFormModel(); _lastParsed = null; ResilienceConfig = null; await ResilienceConfigChanged.InvokeAsync(null); } }