@using ZB.MOM.WW.OtOpcUa.Admin.Services @using ZB.MOM.WW.OtOpcUa.Configuration.Entities @using ZB.MOM.WW.OtOpcUa.Configuration.Enums @inject NamespaceService NsSvc

Namespaces

@if (_namespaces is null) {

Loading…

} else if (_namespaces.Count == 0) {

No namespaces defined in this draft.

} else { @foreach (var n in _namespaces) { }
NamespaceIdKindURIEnabled
@n.NamespaceId@n.Kind@n.NamespaceUri@(n.Enabled ? "yes" : "no")
} @if (_showForm) {
} @code { [Parameter] public long GenerationId { get; set; } [Parameter] public string ClusterId { get; set; } = string.Empty; private List? _namespaces; private bool _showForm; private string _uri = string.Empty; private NamespaceKind _kind = NamespaceKind.Equipment; protected override async Task OnParametersSetAsync() => await ReloadAsync(); private async Task ReloadAsync() => _namespaces = await NsSvc.ListAsync(GenerationId, CancellationToken.None); private async Task SaveAsync() { if (string.IsNullOrWhiteSpace(_uri)) return; await NsSvc.AddAsync(GenerationId, ClusterId, _uri, _kind, CancellationToken.None); _uri = string.Empty; _showForm = false; await ReloadAsync(); } }