@page "/" @using ZB.MOM.WW.OtOpcUa.Admin.Services @using ZB.MOM.WW.OtOpcUa.Configuration.Entities @inject ClusterService ClusterSvc @inject GenerationService GenerationSvc @inject NavigationManager Nav

Fleet overview

@if (_clusters is null) {

Loading…

} else if (_clusters.Count == 0) {
No clusters configured yet. Create the first cluster.
} else {
Clusters
@_clusters.Count
Active drafts
@_activeDraftCount
Published generations
@_publishedCount
Disabled clusters
@_clusters.Count(c => !c.Enabled)

Clusters

@foreach (var c in _clusters) { }
ClusterIdNameEnterprise / SiteRedundancyEnabled
@c.ClusterId @c.Name @c.Enterprise / @c.Site @c.RedundancyMode @(c.Enabled ? "Yes" : "No") Open
} @code { private List? _clusters; private int _activeDraftCount; private int _publishedCount; protected override async Task OnInitializedAsync() { _clusters = await ClusterSvc.ListAsync(CancellationToken.None); foreach (var c in _clusters) { var gens = await GenerationSvc.ListRecentAsync(c.ClusterId, 50, CancellationToken.None); _activeDraftCount += gens.Count(g => g.Status.ToString() == "Draft"); _publishedCount += gens.Count(g => g.Status.ToString() == "Published"); } } }