diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Drivers/DriverResilienceSection.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Drivers/DriverResilienceSection.razor index 968af113..4a05503f 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Drivers/DriverResilienceSection.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Drivers/DriverResilienceSection.razor @@ -1,16 +1,42 @@ -@* Resilience overrides — JSON textarea. Typed-form-ifying Polly is a follow-up; for now this - matches the legacy DriverEdit.razor behaviour exactly. *@ +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers Resilience overrides (optional) - - Polly pipeline overrides per docs/v2/driver-stability.md — bulkhead, retry counts, breaker thresholds. Null = use the driver type's tier defaults. + Blank fields use the driver type's stability-tier defaults + (see docs/v2/driver-stability.md). Set only what you need to override. + + + Bulkhead max concurrent + + Bulkhead max queue + + Recycle interval (s, Tier C only) + + + + + + CapabilityTimeout (s)RetriesBreaker threshold + + @foreach (var cap in ResilienceFormModel.Capabilities) + { + var row = _m.Policies[cap]; + + @cap + + + + + } + + + + + + Raw JSON (advanced) + @(_m.ToJson() ?? "(null — all tier defaults)") + @@ -18,9 +44,24 @@ [Parameter] public string? ResilienceConfig { get; set; } [Parameter] public EventCallback ResilienceConfigChanged { get; set; } - private async Task OnChangedAsync(string? newValue) + private ResilienceFormModel _m = new(); + private string? _lastParsed; + + protected override void OnParametersSet() { - ResilienceConfig = newValue; - await ResilienceConfigChanged.InvokeAsync(newValue); + // 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() + { + var json = _m.ToJson(); + _lastParsed = json; + ResilienceConfig = json; + await ResilienceConfigChanged.InvokeAsync(json); } }
Blank fields use the driver type's stability-tier defaults + (see docs/v2/driver-stability.md). Set only what you need to override.
@(_m.ToJson() ?? "(null — all tier defaults)")