@page "/clusters/{ClusterId}/draft/{GenerationId:long}/diff" @using ZB.MOM.WW.OtOpcUa.Admin.Services @using ZB.MOM.WW.OtOpcUa.Configuration.Entities @using ZB.MOM.WW.OtOpcUa.Configuration.Enums @inject GenerationService GenerationSvc

Draft diff

Cluster @ClusterId — from last published (@(_fromLabel)) → to draft @GenerationId
Back to editor
@if (_rows is null) {

Computing diff…

} else if (_error is not null) {
@_error
} else if (_rows.Count == 0) {

No differences — draft is structurally identical to the last published generation.

} else { @foreach (var r in _rows) { }
TableLogicalIdChangeKind
@r.TableName @r.LogicalId @switch (r.ChangeKind) { case "Added": @r.ChangeKind break; case "Removed": @r.ChangeKind break; case "Modified": @r.ChangeKind break; default: @r.ChangeKind break; }
} @code { [Parameter] public string ClusterId { get; set; } = string.Empty; [Parameter] public long GenerationId { get; set; } private List? _rows; private string _fromLabel = "(empty)"; private string? _error; protected override async Task OnParametersSetAsync() { try { var all = await GenerationSvc.ListRecentAsync(ClusterId, 50, CancellationToken.None); var from = all.FirstOrDefault(g => g.Status == GenerationStatus.Published); _fromLabel = from is null ? "(empty)" : $"gen {from.GenerationId}"; _rows = await GenerationSvc.ComputeDiffAsync(from?.GenerationId ?? 0, GenerationId, CancellationToken.None); } catch (Exception ex) { _error = ex.Message; } } }