@using Microsoft.EntityFrameworkCore @using ZB.MOM.WW.OtOpcUa.AdminUI.Deployments @using ZB.MOM.WW.OtOpcUa.AdminUI.Hubs @using ZB.MOM.WW.OtOpcUa.Configuration @inject CredentialReferencePreflightState State @inject IDriverStatusSnapshotStore DriverStatus @inject IServiceProvider Services @* lmxopcua#815 upgrade preflight surface: stored / deployed configs whose credential references sit outside their driver's namespace (the boot scan, re-runnable here) plus running drivers that reported resolving one through the deprecated warn-only compatibility path (driver-health diagnostics, fleet-wide). Never shows a value. *@ @if (_findings.Count > 0 || _error is not null) { } @code { private const int MaxRows = 25; private IReadOnlyList _findings = []; private string? _error; private bool _busy; protected override void OnInitialized() => Compose(State.Current); private void Compose(CredentialReferencePreflightState.Snapshot snapshot) { _error = snapshot.Error; _findings = snapshot.Findings .Concat(CredentialReferencePreflight.RunningFindings(DriverStatus.GetAll())) .ToList(); } private async Task RecheckAsync() { var factory = Services.GetService(typeof(IDbContextFactory)) as IDbContextFactory; if (factory is null) return; _busy = true; try { var findings = await new CredentialReferencePreflight(factory).ScanAsync(CancellationToken.None); var snapshot = new CredentialReferencePreflightState.Snapshot(findings, DateTime.UtcNow, null); State.Set(snapshot); Compose(snapshot); } catch (Exception) { _error = "The credential-reference preflight could not read the config DB."; } finally { _busy = false; } } }