@page "/clusters/{ClusterId}" @attribute [Microsoft.AspNetCore.Authorization.Authorize] @rendermode RenderMode.InteractiveServer @using Microsoft.EntityFrameworkCore @using ZB.MOM.WW.OtOpcUa.Configuration @using ZB.MOM.WW.OtOpcUa.Configuration.Entities @inject IDbContextFactory DbFactory @inject NavigationManager Nav @if (!_loaded) {

Loading…

} else if (_cluster is null) {
Cluster @ClusterId was not found. Back to list.
} else {

@_cluster.Name

@_cluster.ClusterId @if (!_cluster.Enabled) { Disabled }
Deployments
Cluster details
Enterprise / Site@_cluster.Enterprise / @_cluster.Site
Redundancy@_cluster.RedundancyMode (@_cluster.NodeCount node@(_cluster.NodeCount == 1 ? "" : "s"))
Created@_cluster.CreatedAt.ToString("u") by @_cluster.CreatedBy
@if (_cluster.ModifiedAt is not null) {
Modified@_cluster.ModifiedAt?.ToString("u") by @(_cluster.ModifiedBy ?? "—")
} @if (!string.IsNullOrWhiteSpace(_cluster.Notes)) {
Notes@_cluster.Notes
}
Last deployment
@if (_lastDeployment is null) {
Statusnone — cluster has never been deployed
} else {
Revision@_lastDeployment.RevisionHash[..16]…
Status@_lastDeployment.Status
Created@_lastDeployment.CreatedAtUtc.ToString("u")
@if (_lastDeployment.SealedAtUtc is not null) {
Sealed@_lastDeployment.SealedAtUtc?.ToString("u")
} }
Nodes
@if (_nodes is null || _nodes.Count == 0) {
No nodes registered.
} else {
@foreach (var n in _nodes) { }
Node ID Host OPC UA port ApplicationUri ServiceLevel base
@n.NodeId @n.Host @n.OpcUaPort @n.ApplicationUri @n.ServiceLevelBase
}
} @code { [Parameter] public string ClusterId { get; set; } = ""; private bool _loaded; private ServerCluster? _cluster; private List? _nodes; private Deployment? _lastDeployment; protected override async Task OnInitializedAsync() { await using var db = await DbFactory.CreateDbContextAsync(); _cluster = await db.ServerClusters.AsNoTracking() .FirstOrDefaultAsync(c => c.ClusterId == ClusterId); if (_cluster is not null) { _nodes = await db.ClusterNodes.AsNoTracking() .Where(n => n.ClusterId == ClusterId) .OrderBy(n => n.NodeId) .ToListAsync(); _lastDeployment = await db.Deployments.AsNoTracking() .OrderByDescending(d => d.CreatedAtUtc) .FirstOrDefaultAsync(); } _loaded = true; } }