feat(grpc-data): A2a AdminUI AlarmSubscribe checkbox, condition limit fields, capacity warning
Connection/export/mapping editors offer AlarmSubscribe (DataOperationAuthoring; method bits stay unauthorable until A2b); export MaxConditions and mapping MaxConditions / ConditionStale / ConditionMethod / ConditionSnapshot timeouts with the validator's min/max; the X0 banner already shows for any post-v1 bit. The Mappings panel lists the validator's non-blocking ConditionCapacityWarnings for this cluster's consumer nodes. AllowGalaxyServiceAck is not in the UI (A2b).
This commit is contained in:
+6
@@ -77,6 +77,7 @@ else
|
||||
</section>
|
||||
<section class="panel mt-3"><h2 class="panel-head">Mappings</h2><div class="p-3">
|
||||
@if (!Mappings.Any()) { <p class="text-muted">No remote branches have been mapped.</p> }
|
||||
@foreach (var w in DataOperationAuthoring.ConditionCapacityWarnings(_snapshot!, ClusterId)) { <div class="notice mb-2" role="note">@w</div> }
|
||||
@foreach (var m in Mappings) { <div class="d-flex flex-wrap gap-2 align-items-center mb-2"><strong>@m.RemoteNamespaceMappingId</strong><span>@m.Realm · @m.BranchName via @m.DataConnectionId</span><span class="chip chip-idle">Draft: @(m.Enabled ? "enabled" : "disabled")</span><AuthorizeView Policy="@AdminUiPolicies.ConfigEditor"><button class="btn btn-sm btn-outline-primary" @onclick="() => Edit(m)">Edit</button></AuthorizeView></div> }
|
||||
<AuthorizeView Policy="@AdminUiPolicies.ConfigEditor"><button class="btn btn-sm btn-primary" @onclick="NewMapping">New mapping</button></AuthorizeView></div>
|
||||
</section>
|
||||
@@ -116,6 +117,7 @@ else
|
||||
<label class="form-label" for="export-history-reads">Concurrent history reads per peer</label><input id="export-history-reads" type="number" min="1" max="@DataConnectionValidator.MaxConcurrentHistoryReadsLimit" class="form-control mb-2" @bind="e.MaxConcurrentHistoryReads" />
|
||||
<label class="form-label" for="export-history-page">History values per page</label><input id="export-history-page" type="number" min="1" max="@DataConnectionValidator.MaxHistoryValuesPerPageLimit" class="form-control mb-2" @bind="e.MaxHistoryValuesPerPage" />
|
||||
<label class="form-label" for="export-history-bytes">History response bytes</label><input id="export-history-bytes" type="number" min="@DataConnectionValidator.MinHistoryResponseBytesLimit" max="@DataConnectionValidator.MaxHistoryResponseBytesLimit" class="form-control mb-2" @bind="e.MaxHistoryResponseBytes" /><div class="form-text">Larger answers are sent in bounded chunks.</div>
|
||||
<label class="form-label" for="export-max-conditions">Conditions per alarm subscription</label><input id="export-max-conditions" type="number" min="1" max="@DataConnectionValidator.MaxConditionsLimit" class="form-control mb-2" @bind="e.MaxConditions" /><div class="form-text">A remote AlarmSubscribe scope with more conditions than this is refused (ConditionCapacity) before anything is imported.</div>
|
||||
<label><input type="checkbox" @bind="e.Enabled" /> Enabled in next deployment</label>@Actions(e, e.DataExportRowId != Guid.Empty)
|
||||
</div></section>
|
||||
}
|
||||
@@ -134,6 +136,10 @@ else
|
||||
<fieldset><legend class="fs-6">Consumer nodes</legend>@foreach (var n in Nodes) { <label class="me-3"><input type="checkbox" checked="@m.ConsumerNodeIds.Contains(n.NodeId)" @onchange="e => Toggle(m.ConsumerNodeIds, n.NodeId, (bool)e.Value!)" /> @n.NodeId</label> }</fieldset>
|
||||
@Operations(m.AllowedOperations, v => m.AllowedOperations = v)
|
||||
<label class="form-label" for="mapping-history-bytes">History assembly bytes per request</label><input id="mapping-history-bytes" type="number" min="1" max="@DataConnectionValidator.MaxHistoryAssemblyBytesLimit" class="form-control mb-2" @bind="m.MaxHistoryAssemblyBytesPerRequest" />
|
||||
<label class="form-label" for="mapping-max-conditions">Maximum imported conditions</label><input id="mapping-max-conditions" type="number" min="1" max="@DataConnectionValidator.MaxConditionsLimit" class="form-control mb-2" @bind="m.MaxConditions" /><div class="form-text">A remote alarm scope larger than this makes the mapping's alarms Unavailable (ConditionCapacity); each imported condition materialises up to @DataConnectionValidator.NodesPerImportedCondition nodes.</div>
|
||||
<label class="form-label" for="mapping-condition-stale">Condition stale timeout (ms)</label><input id="mapping-condition-stale" type="number" min="1" max="@DataConnectionValidator.MaxConditionTimeoutMilliseconds" class="form-control mb-2" @bind="m.ConditionStaleTimeoutMilliseconds" />
|
||||
<label class="form-label" for="mapping-condition-method">Condition method timeout (ms)</label><input id="mapping-condition-method" type="number" min="1" max="@DataConnectionValidator.MaxConditionTimeoutMilliseconds" class="form-control mb-2" @bind="m.ConditionMethodTimeoutMilliseconds" />
|
||||
<label class="form-label" for="mapping-condition-snapshot">Condition snapshot timeout (ms)</label><input id="mapping-condition-snapshot" type="number" min="1" max="@DataConnectionValidator.MaxConditionTimeoutMilliseconds" class="form-control mb-2" @bind="m.ConditionSnapshotTimeoutMilliseconds" />
|
||||
<div><label><input type="checkbox" @bind="m.WriteThrough" /> Allow write-through</label></div><label><input type="checkbox" @bind="m.Enabled" /> Enabled in next deployment</label>@Actions(m, m.RemoteNamespaceMappingRowId != Guid.Empty)
|
||||
</div></section>
|
||||
}
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
using ZB.MOM.WW.OtOpcUa.Configuration.Validation;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.AdminUI.DataConnections;
|
||||
|
||||
/// <summary>
|
||||
/// The operation checkboxes the data-connection editors offer, and the mixed-version banner (plan §4.3). The set
|
||||
/// grows with the authoring validator, never ahead of it: H2 adds <see cref="DataOperations.HistoryRead"/>.
|
||||
/// grows with the authoring validator, never ahead of it: H2 adds <see cref="DataOperations.HistoryRead"/>, A2a
|
||||
/// <see cref="DataOperations.AlarmSubscribe"/> (A2b the method bits).
|
||||
/// </summary>
|
||||
public static class DataOperationAuthoring
|
||||
{
|
||||
/// <summary>The operation bits an operator can tick, in display order.</summary>
|
||||
public static IReadOnlyList<DataOperations> AuthorableOperations { get; } =
|
||||
[DataOperations.Browse, DataOperations.Metadata, DataOperations.Read, DataOperations.Subscribe, DataOperations.Write, DataOperations.HistoryRead];
|
||||
[DataOperations.Browse, DataOperations.Metadata, DataOperations.Read, DataOperations.Subscribe, DataOperations.Write, DataOperations.HistoryRead,
|
||||
DataOperations.AlarmSubscribe];
|
||||
|
||||
/// <summary>The checkbox label of a bit.</summary>
|
||||
public static string Label(DataOperations operation) => operation == DataOperations.HistoryRead ? "HistoryRead" : operation.ToString();
|
||||
public static string Label(DataOperations operation) => operation.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// The informational banner shown while a post-v1 feature bit is ticked: ConfigDb records no node build, so the
|
||||
@@ -22,4 +25,18 @@ public static class DataOperationAuthoring
|
||||
public static string? FeatureBitBanner(DataOperations operations) => (operations & ~DataOperationSets.V1) == 0 ? null
|
||||
: "Every node of both clusters must run X0+ before authoring this: a pre-X0 node rejects the whole data-connection "
|
||||
+ "snapshot when a row carries an operation bit it does not know. Nothing checks this automatically.";
|
||||
|
||||
/// <summary>
|
||||
/// The validator's non-blocking condition-capacity warnings (plan §5.5/§6) for this cluster's consumer nodes, computed on
|
||||
/// the saved drafts with the host default <c>DataConnections:MaxImportedConditionNodes</c>.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> ConditionCapacityWarnings(DraftSnapshot snapshot, string clusterId)
|
||||
{
|
||||
var nodes = snapshot.ClusterNodes.Where(n => string.Equals(n.ClusterId, clusterId, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(n => n.NodeId).ToHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
return DataConnectionValidator.ConditionCapacityWarnings(snapshot)
|
||||
.Where(w => w.Context is not null && nodes.Contains(w.Context))
|
||||
.Select(w => w.Message + " The cap is the host's setting; this check assumes its default.")
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user