Associate ScadaBridge controls, guidance and editor errors
This commit is contained in:
@@ -29,34 +29,34 @@
|
||||
|
||||
@* Kind options are narrowed by the Channel selection (VisibleKinds). *@
|
||||
<div class="col-auto" data-test="filter-kind">
|
||||
<label class="form-label small mb-1">Kind</label>
|
||||
<label id="audit-kind-label" class="form-label small mb-1">Kind</label>
|
||||
<div>
|
||||
<MultiSelectDropdown TValue="AuditKind"
|
||||
Items="_model.VisibleKinds()"
|
||||
Selected="_model.Kinds"
|
||||
DataTest="filter-kind-ms" />
|
||||
LabelledBy="audit-kind-label" DataTest="filter-kind-ms" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-auto" data-test="filter-status">
|
||||
<label class="form-label small mb-1">Status</label>
|
||||
<label id="audit-status-label" class="form-label small mb-1">Status</label>
|
||||
<div>
|
||||
<MultiSelectDropdown TValue="AuditStatus"
|
||||
Items="_statuses"
|
||||
Selected="_model.Statuses"
|
||||
DataTest="filter-status-ms" />
|
||||
LabelledBy="audit-status-label" DataTest="filter-status-ms" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-auto" data-test="filter-site">
|
||||
<label class="form-label small mb-1">Site</label>
|
||||
<label id="audit-site-label" class="form-label small mb-1">Site</label>
|
||||
<div>
|
||||
<MultiSelectDropdown TValue="string"
|
||||
Items="_siteIds"
|
||||
Selected="_model.SiteIdentifiers"
|
||||
Display="SiteName"
|
||||
EmptyText="No sites available"
|
||||
DataTest="filter-site-ms" />
|
||||
LabelledBy="audit-site-label" DataTest="filter-site-ms" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,13 +65,13 @@
|
||||
for 60s so a render of this bar costs at most one DB hit per
|
||||
minute per circuit. *@
|
||||
<div class="col-auto" data-test="filter-node">
|
||||
<label class="form-label small mb-1">Node</label>
|
||||
<label id="audit-node-label" class="form-label small mb-1">Node</label>
|
||||
<div>
|
||||
<MultiSelectDropdown TValue="string"
|
||||
Items="_sourceNodes"
|
||||
Selected="_model.SourceNodes"
|
||||
EmptyText="No nodes available"
|
||||
DataTest="filter-node-ms" />
|
||||
LabelledBy="audit-node-label" DataTest="filter-node-ms" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
@if (ShowSearch)
|
||||
{
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control" data-test="node-search-input"
|
||||
<input aria-label="Search nodes" class="form-control" data-test="node-search-input"
|
||||
@bind="_searchQuery" @bind:event="oninput"
|
||||
@onkeydown="SearchOnEnter"
|
||||
placeholder="Search the address space by name or path…" />
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">Manual node id:</span>
|
||||
<input class="form-control" @bind="_manualNodeId" @bind:event="oninput" placeholder="nsu=<namespace-uri>;s=..." />
|
||||
<input aria-label="Node identifier" class="form-control" @bind="_manualNodeId" @bind:event="oninput" placeholder="nsu=<namespace-uri>;s=..." />
|
||||
<button class="btn btn-outline-secondary" @onclick="UseManual" disabled="@string.IsNullOrWhiteSpace(_manualNodeId)">Use</button>
|
||||
</div>
|
||||
@if (!OpcUaReferenceForm.IsDurable(_manualNodeId))
|
||||
|
||||
+22
-18
@@ -12,15 +12,15 @@
|
||||
<legend class="h6">Connection</legend>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small">Gateway endpoint</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Gateway endpoint</label>
|
||||
<input aria-invalid="@(FieldError("Endpoint") is not null ? "true" : "false")" aria-describedby="@(FieldError("Endpoint") is not null ? ErrorId("Endpoint") : null)" id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.Endpoint"
|
||||
placeholder="http://host:5000" />
|
||||
@RenderFieldError("Endpoint")
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small">API key</label>
|
||||
<input type="password" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">API key</label>
|
||||
<input aria-invalid="@(FieldError("ApiKey") is not null ? "true" : "false")" aria-describedby="@(FieldError("ApiKey") is not null ? ErrorId("ApiKey") : null)" id="@($"{_fieldScope}-field-2")" type="password" class="form-control form-control-sm"
|
||||
@bind="Config.ApiKey"
|
||||
placeholder="gateway API key" />
|
||||
@RenderFieldError("ApiKey")
|
||||
@@ -29,19 +29,19 @@
|
||||
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small">Client name</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Client name</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.ClientName"
|
||||
placeholder="(defaults to scadabridge)" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Write user id</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-4")">Write user id</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.WriteUserId" min="0" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Read timeout (ms)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-5")">Read timeout (ms)</label>
|
||||
<input aria-invalid="@(FieldError("ReadTimeoutMs") is not null ? "true" : "false")" aria-describedby="@(FieldError("ReadTimeoutMs") is not null ? ErrorId("ReadTimeoutMs") : null)" id="@($"{_fieldScope}-field-5")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.ReadTimeoutMs" min="1" />
|
||||
@RenderFieldError("ReadTimeoutMs")
|
||||
</div>
|
||||
@@ -63,14 +63,14 @@
|
||||
@if (Config.UseTls)
|
||||
{
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small">CA certificate path</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-6")">CA certificate path</label>
|
||||
<input id="@($"{_fieldScope}-field-6")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.CaFile"
|
||||
placeholder="/etc/scadabridge/pki/gateway-ca.pem" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Server name override</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-7")">Server name override</label>
|
||||
<input id="@($"{_fieldScope}-field-7")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.ServerName"
|
||||
placeholder="gateway.example.local" />
|
||||
</div>
|
||||
@@ -85,15 +85,19 @@
|
||||
[Parameter] public string IdPrefix { get; set; } = "mxgateway-endpoint";
|
||||
[Parameter] public ValidationResult? Errors { get; set; }
|
||||
|
||||
private ValidationEntry? FieldError(string field) => Errors?.Errors.FirstOrDefault(e =>
|
||||
e.EntityName != null && (e.EntityName == field || e.EntityName.EndsWith("." + field)));
|
||||
private string ErrorId(string field) => _fieldScope + "-error-" + field.Replace('.', '-');
|
||||
|
||||
private RenderFragment? RenderFieldError(string field)
|
||||
{
|
||||
var match = Errors?.Errors.FirstOrDefault(e =>
|
||||
e.EntityName != null
|
||||
&& (e.EntityName == field || e.EntityName.EndsWith("." + field)));
|
||||
var match = FieldError(field);
|
||||
// Validator text can carry raw, unbounded detail — clamp it and keep the full
|
||||
// message reachable via the title so it cannot reflow the surrounding row.
|
||||
return match is null
|
||||
? null
|
||||
: @<div class="text-danger small cell-clamp-2" title="@match.Message">@match.Message</div>;
|
||||
: @<div id="@ErrorId(field)" role="alert" class="text-danger small cell-clamp-2" title="@match.Message">@match.Message</div>;
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
<legend class="h6">Connection</legend>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small">Endpoint URL</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Endpoint URL</label>
|
||||
<input aria-invalid="@(FieldError("EndpointUrl") is not null ? "true" : "false")" aria-describedby="@(FieldError("EndpointUrl") is not null ? ErrorId("EndpointUrl") : null)" id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.EndpointUrl"
|
||||
placeholder="opc.tcp://host:4840" />
|
||||
@RenderFieldError("EndpointUrl")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Security Mode</label>
|
||||
<select class="form-select form-select-sm" @bind="Config.SecurityMode">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Security Mode</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" @bind="Config.SecurityMode">
|
||||
<option value="@OpcUaSecurityMode.None">None</option>
|
||||
<option value="@OpcUaSecurityMode.Sign">Sign</option>
|
||||
<option value="@OpcUaSecurityMode.SignAndEncrypt">Sign & Encrypt</option>
|
||||
@@ -164,8 +164,8 @@
|
||||
{
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Token type</label>
|
||||
<select class="form-select form-select-sm" @bind="Config.UserIdentity.TokenType">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Token type</label>
|
||||
<select id="@($"{_fieldScope}-field-3")" class="form-select form-select-sm" @bind="Config.UserIdentity.TokenType">
|
||||
<option value="@OpcUaUserTokenType.Anonymous">Anonymous</option>
|
||||
<option value="@OpcUaUserTokenType.UsernamePassword">Username / Password</option>
|
||||
<option value="@OpcUaUserTokenType.X509Certificate">X.509 Certificate</option>
|
||||
@@ -174,29 +174,29 @@
|
||||
@if (Config.UserIdentity.TokenType == OpcUaUserTokenType.UsernamePassword)
|
||||
{
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Username</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-4")">Username</label>
|
||||
<input aria-invalid="@(FieldError("UserIdentity.Username") is not null ? "true" : "false")" aria-describedby="@(FieldError("UserIdentity.Username") is not null ? ErrorId("UserIdentity.Username") : null)" id="@($"{_fieldScope}-field-4")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.UserIdentity.Username" />
|
||||
@RenderFieldError("UserIdentity.Username")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Password</label>
|
||||
<input type="password" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-5")">Password</label>
|
||||
<input id="@($"{_fieldScope}-field-5")" type="password" class="form-control form-control-sm"
|
||||
@bind="Config.UserIdentity.Password" />
|
||||
</div>
|
||||
}
|
||||
else if (Config.UserIdentity.TokenType == OpcUaUserTokenType.X509Certificate)
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Certificate path</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-6")">Certificate path</label>
|
||||
<input aria-invalid="@(FieldError("UserIdentity.CertificatePath") is not null ? "true" : "false")" aria-describedby="@(FieldError("UserIdentity.CertificatePath") is not null ? ErrorId("UserIdentity.CertificatePath") : null)" id="@($"{_fieldScope}-field-6")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.UserIdentity.CertificatePath"
|
||||
placeholder="/etc/scadabridge/pki/client.pfx" />
|
||||
@RenderFieldError("UserIdentity.CertificatePath")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Certificate password</label>
|
||||
<input type="password" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-7")">Certificate password</label>
|
||||
<input id="@($"{_fieldScope}-field-7")" type="password" class="form-control form-control-sm"
|
||||
@bind="Config.UserIdentity.CertificatePassword" />
|
||||
</div>
|
||||
}
|
||||
@@ -214,14 +214,14 @@
|
||||
<legend class="h6">Timing</legend>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Session timeout (ms)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-8")">Session timeout (ms)</label>
|
||||
<input aria-invalid="@(FieldError("SessionTimeoutMs") is not null ? "true" : "false")" aria-describedby="@(FieldError("SessionTimeoutMs") is not null ? ErrorId("SessionTimeoutMs") : null)" id="@($"{_fieldScope}-field-8")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.SessionTimeoutMs" min="1" />
|
||||
@RenderFieldError("SessionTimeoutMs")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Operation timeout (ms)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-9")">Operation timeout (ms)</label>
|
||||
<input aria-invalid="@(FieldError("OperationTimeoutMs") is not null ? "true" : "false")" aria-describedby="@(FieldError("OperationTimeoutMs") is not null ? ErrorId("OperationTimeoutMs") : null)" id="@($"{_fieldScope}-field-9")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.OperationTimeoutMs" min="1" />
|
||||
@RenderFieldError("OperationTimeoutMs")
|
||||
</div>
|
||||
@@ -232,38 +232,38 @@
|
||||
<legend class="h6">Subscription</legend>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Publishing interval (ms)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-10")">Publishing interval (ms)</label>
|
||||
<input aria-invalid="@(FieldError("PublishingIntervalMs") is not null ? "true" : "false")" aria-describedby="@(FieldError("PublishingIntervalMs") is not null ? ErrorId("PublishingIntervalMs") : null)" id="@($"{_fieldScope}-field-10")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.PublishingIntervalMs" min="1" />
|
||||
@RenderFieldError("PublishingIntervalMs")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Sampling interval (ms)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-11")">Sampling interval (ms)</label>
|
||||
<input aria-invalid="@(FieldError("SamplingIntervalMs") is not null ? "true" : "false")" aria-describedby="@(FieldError("SamplingIntervalMs") is not null ? ErrorId("SamplingIntervalMs") : null)" id="@($"{_fieldScope}-field-11")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.SamplingIntervalMs" min="1" />
|
||||
@RenderFieldError("SamplingIntervalMs")
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label small">Queue size</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-12")">Queue size</label>
|
||||
<input aria-invalid="@(FieldError("QueueSize") is not null ? "true" : "false")" aria-describedby="@(FieldError("QueueSize") is not null ? ErrorId("QueueSize") : null)" id="@($"{_fieldScope}-field-12")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.QueueSize" min="1" />
|
||||
@RenderFieldError("QueueSize")
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label small">Keep-alive count</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-13")">Keep-alive count</label>
|
||||
<input aria-invalid="@(FieldError("KeepAliveCount") is not null ? "true" : "false")" aria-describedby="@(FieldError("KeepAliveCount") is not null ? ErrorId("KeepAliveCount") : null)" id="@($"{_fieldScope}-field-13")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.KeepAliveCount" min="1" />
|
||||
@RenderFieldError("KeepAliveCount")
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label small">Lifetime count</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-14")">Lifetime count</label>
|
||||
<input aria-invalid="@(FieldError("LifetimeCount") is not null ? "true" : "false")" aria-describedby="@(FieldError("LifetimeCount") is not null ? ErrorId("LifetimeCount") : null)" id="@($"{_fieldScope}-field-14")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.LifetimeCount" min="1" />
|
||||
@RenderFieldError("LifetimeCount")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Max notifications / publish</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-15")">Max notifications / publish</label>
|
||||
<input aria-invalid="@(FieldError("MaxNotificationsPerPublish") is not null ? "true" : "false")" aria-describedby="@(FieldError("MaxNotificationsPerPublish") is not null ? ErrorId("MaxNotificationsPerPublish") : null)" id="@($"{_fieldScope}-field-15")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.MaxNotificationsPerPublish" min="1" />
|
||||
@RenderFieldError("MaxNotificationsPerPublish")
|
||||
</div>
|
||||
@@ -274,19 +274,19 @@
|
||||
<legend class="h6">Advanced subscription</legend>
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Subscription display name</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-16")">Subscription display name</label>
|
||||
<input aria-invalid="@(FieldError("SubscriptionDisplayName") is not null ? "true" : "false")" aria-describedby="@(FieldError("SubscriptionDisplayName") is not null ? ErrorId("SubscriptionDisplayName") : null)" id="@($"{_fieldScope}-field-16")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.SubscriptionDisplayName" />
|
||||
@RenderFieldError("SubscriptionDisplayName")
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label small">Subscription priority</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-17")">Subscription priority</label>
|
||||
<input id="@($"{_fieldScope}-field-17")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.SubscriptionPriority" min="0" max="255" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Timestamps to return</label>
|
||||
<select class="form-select form-select-sm" @bind="Config.TimestampsToReturn">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-18")">Timestamps to return</label>
|
||||
<select id="@($"{_fieldScope}-field-18")" class="form-select form-select-sm" @bind="Config.TimestampsToReturn">
|
||||
<option value="@OpcUaTimestampsToReturn.Source">Source</option>
|
||||
<option value="@OpcUaTimestampsToReturn.Server">Server</option>
|
||||
<option value="@OpcUaTimestampsToReturn.Both">Both</option>
|
||||
@@ -315,15 +315,15 @@
|
||||
{
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Type</label>
|
||||
<select class="form-select form-select-sm" @bind="Config.Deadband.Type">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-19")">Type</label>
|
||||
<select id="@($"{_fieldScope}-field-19")" class="form-select form-select-sm" @bind="Config.Deadband.Type">
|
||||
<option value="@OpcUaDeadbandType.Absolute">Absolute</option>
|
||||
<option value="@OpcUaDeadbandType.Percent">Percent</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Value</label>
|
||||
<input type="number" step="0.01" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-20")">Value</label>
|
||||
<input aria-invalid="@(FieldError("Deadband.Value") is not null ? "true" : "false")" aria-describedby="@(FieldError("Deadband.Value") is not null ? ErrorId("Deadband.Value") : null)" id="@($"{_fieldScope}-field-20")" type="number" step="0.01" class="form-control form-control-sm"
|
||||
@bind="Config.Deadband.Value" min="0" />
|
||||
@RenderFieldError("Deadband.Value")
|
||||
</div>
|
||||
@@ -348,15 +348,15 @@
|
||||
{
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small">Tag path</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-21")">Tag path</label>
|
||||
<input aria-invalid="@(FieldError("Heartbeat.TagPath") is not null ? "true" : "false")" aria-describedby="@(FieldError("Heartbeat.TagPath") is not null ? ErrorId("Heartbeat.TagPath") : null)" id="@($"{_fieldScope}-field-21")" type="text" class="form-control form-control-sm"
|
||||
@bind="Config.Heartbeat.TagPath"
|
||||
placeholder="Sensors.Heartbeat" />
|
||||
@RenderFieldError("Heartbeat.TagPath")
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Max silence (s)</label>
|
||||
<input type="number" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-22")">Max silence (s)</label>
|
||||
<input aria-invalid="@(FieldError("Heartbeat.MaxSilenceSeconds") is not null ? "true" : "false")" aria-describedby="@(FieldError("Heartbeat.MaxSilenceSeconds") is not null ? ErrorId("Heartbeat.MaxSilenceSeconds") : null)" id="@($"{_fieldScope}-field-22")" type="number" class="form-control form-control-sm"
|
||||
@bind="Config.Heartbeat.MaxSilenceSeconds" min="1" />
|
||||
@RenderFieldError("Heartbeat.MaxSilenceSeconds")
|
||||
</div>
|
||||
@@ -468,13 +468,17 @@
|
||||
private void EnableDeadband() =>
|
||||
Config.Deadband = new OpcUaDeadbandConfig();
|
||||
|
||||
private ValidationEntry? FieldError(string field) => Errors?.Errors.FirstOrDefault(e =>
|
||||
e.EntityName != null && (e.EntityName == field || e.EntityName.EndsWith("." + field)));
|
||||
private string ErrorId(string field) => _fieldScope + "-error-" + field.Replace('.', '-');
|
||||
|
||||
private RenderFragment? RenderFieldError(string field)
|
||||
{
|
||||
var match = Errors?.Errors.FirstOrDefault(e =>
|
||||
e.EntityName != null
|
||||
&& (e.EntityName == field || e.EntityName.EndsWith("." + field)));
|
||||
var match = FieldError(field);
|
||||
return match is null
|
||||
? null
|
||||
: @<div class="text-danger small">@match.Message</div>;
|
||||
: @<div id="@ErrorId(field)" role="alert" class="text-danger small">@match.Message</div>;
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -70,15 +70,15 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Name</label>
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
@* Name is fixed on edit — the seam has no rename. *@
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formName" disabled="@IsEditMode" />
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm" @bind="_formName" disabled="@IsEditMode" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">API Method Access</label>
|
||||
<div class="mb-2" role="group" aria-labelledby="@($"{_fieldScope}-methods-label")" aria-describedby="@($"{_fieldScope}-methods-hint")">
|
||||
<div id="@($"{_fieldScope}-methods-label")" class="form-label small">API Method Access</div>
|
||||
@if (_allMethods.Count == 0)
|
||||
{
|
||||
<div class="form-text">
|
||||
<div id="@($"{_fieldScope}-methods-hint")" class="form-text">
|
||||
No API methods configured.
|
||||
<a href="/design/external-systems">Create one</a> to grant access.
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<div id="@($"{_fieldScope}-methods-hint")" class="form-text">
|
||||
Callers using this key can invoke any checked method. At least one is required.
|
||||
</div>
|
||||
}
|
||||
@@ -237,3 +237,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter API keys" class="form-control form-control-sm"
|
||||
placeholder="Filter by name…"
|
||||
@bind="_search" @bind:event="oninput" />
|
||||
</div>
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Mapping</h5>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">LDAP Group Name</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formGroupName" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">LDAP Group Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm" @bind="_formGroupName" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Role</label>
|
||||
<select class="form-select form-select-sm" @bind="_formRole">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Role</label>
|
||||
<select aria-describedby="@($"{_fieldScope}-role-hint")" id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" @bind="_formRole">
|
||||
<option value="">Select role...</option>
|
||||
<option value="@Roles.Administrator">Administrator</option>
|
||||
<option value="@Roles.Designer">Designer</option>
|
||||
@@ -40,7 +40,7 @@
|
||||
<option value="@Roles.Operator">Operator</option>
|
||||
<option value="@Roles.Verifier">Verifier</option>
|
||||
</select>
|
||||
<div class="form-text">Deployer role: configure site scope below after saving.</div>
|
||||
<div id="@($"{_fieldScope}-role-hint")" class="form-text">Deployer role: configure site scope below after saving.</div>
|
||||
</div>
|
||||
@if (_formError != null)
|
||||
{
|
||||
@@ -89,8 +89,8 @@
|
||||
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-auto">
|
||||
<label class="form-label small">Site</label>
|
||||
<select class="form-select form-select-sm" @bind="_scopeRuleSiteId">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-3")" class="form-select form-select-sm" @bind="_scopeRuleSiteId">
|
||||
<option value="0">Select site...</option>
|
||||
@foreach (var site in _sites)
|
||||
{
|
||||
@@ -219,3 +219,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter LDAP mappings" class="form-control form-control-sm"
|
||||
placeholder="Filter by name, LDAP group, or role…"
|
||||
@bind="_search" @bind:event="oninput" />
|
||||
</div>
|
||||
|
||||
@@ -38,17 +38,17 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Identifier</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formIdentifier"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Identifier</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm" @bind="_formIdentifier"
|
||||
disabled="@IsEditMode" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Name</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formName" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control form-control-sm" @bind="_formName" />
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label small">Description</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formDescription" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Description</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="text" class="form-control form-control-sm" @bind="_formDescription" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,17 +59,17 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Akka Address (legacy — unused)</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formNodeAAddress"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-4")">Akka Address (legacy — unused)</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-4")" type="text" class="form-control form-control-sm" @bind="_formNodeAAddress"
|
||||
placeholder="akka.tcp://scadabridge@host:port/user/site-communication" />
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">
|
||||
Retained for historical configuration only — nothing reads it at runtime.
|
||||
Central dials the gRPC address below.
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label small">gRPC Address</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formGrpcNodeAAddress"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-5")">gRPC Address</label>
|
||||
<input id="@($"{_fieldScope}-field-5")" type="text" class="form-control form-control-sm" @bind="_formGrpcNodeAAddress"
|
||||
placeholder="http://host:8083" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,17 +81,17 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Akka Address (legacy — unused)</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formNodeBAddress"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-6")">Akka Address (legacy — unused)</label>
|
||||
<input aria-describedby="@($"{_helpScope}-1")" id="@($"{_fieldScope}-field-6")" type="text" class="form-control form-control-sm" @bind="_formNodeBAddress"
|
||||
placeholder="akka.tcp://scadabridge@host:port/user/site-communication" />
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-1")">
|
||||
Retained for historical configuration only — nothing reads it at runtime.
|
||||
Central dials the gRPC address below.
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label small">gRPC Address</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formGrpcNodeBAddress"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-7")">gRPC Address</label>
|
||||
<input id="@($"{_fieldScope}-field-7")" type="text" class="form-control form-control-sm" @bind="_formGrpcNodeBAddress"
|
||||
placeholder="http://host:8083" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,3 +180,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter sites" class="form-control form-control-sm"
|
||||
placeholder="Filter by name or identifier…"
|
||||
@bind="_search" @bind:event="oninput" />
|
||||
</div>
|
||||
|
||||
+8
-6
@@ -11,8 +11,8 @@
|
||||
@if (RequireSitePicker)
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Site</label>
|
||||
<select class="form-select form-select-sm" @bind="_siteId">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" @bind="_siteId">
|
||||
<option value="0">(Select a site)</option>
|
||||
@foreach (var opt in SiteOptions)
|
||||
{
|
||||
@@ -21,8 +21,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Parent area</label>
|
||||
<select class="form-select form-select-sm" @bind="_parentAreaId">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Parent area</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" @bind="_parentAreaId">
|
||||
<option value="0">(Site root)</option>
|
||||
@foreach (var opt in ParentOptions.Where(o => SelectedSiteMatches(o)))
|
||||
{
|
||||
@@ -37,8 +37,8 @@
|
||||
@ContextLabel
|
||||
</div>
|
||||
}
|
||||
<label class="form-label small">Name</label>
|
||||
<input class="form-control form-control-sm" placeholder="Area name" @bind="_name" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" class="form-control form-control-sm" placeholder="Area name" @bind="_name" />
|
||||
@if (!string.IsNullOrEmpty(ErrorMessage)) { <div class="text-danger small mt-1">@ErrorMessage</div> }
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -94,3 +94,5 @@
|
||||
await OnSubmit.InvokeAsync((effectiveSite, effectiveParent, _name.Trim()));
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -70,8 +70,8 @@
|
||||
|
||||
<div class="row mb-3 g-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Site</label>
|
||||
<select class="form-select form-select-sm" data-test="debug-site-select"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" data-test="debug-site-select"
|
||||
@bind="_selectedSiteId" @bind:after="LoadInstancesForSite" disabled="@_connected">
|
||||
<option value="0">Select site...</option>
|
||||
@foreach (var site in _sites)
|
||||
@@ -81,7 +81,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Instance</label>
|
||||
<div class="form-label small">Instance</div>
|
||||
<InstancePicker Areas="_siteAreas" Instances="_siteInstances"
|
||||
ItemLabel="InstanceLabel"
|
||||
SelectedInstanceId="_selectedInstanceId" SelectedInstanceIdChanged="OnInstancePicked"
|
||||
@@ -837,3 +837,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+22
-18
@@ -20,7 +20,7 @@
|
||||
@if (_canLive)
|
||||
{
|
||||
<div class="col-auto">
|
||||
<label class="form-label form-label-sm">Entry point</label>
|
||||
<div class="form-label form-label-sm">Entry point</div>
|
||||
<div class="btn-group btn-group-sm d-block" role="group" aria-label="Entry point">
|
||||
<button type="button" class="btn @(_entry == EntryKind.Method ? "btn-primary" : "btn-outline-secondary")"
|
||||
data-test="flow-entry-method" disabled="@(_running || _methodLiveRefused)"
|
||||
@@ -37,8 +37,8 @@
|
||||
@if (_entry == EntryKind.Method)
|
||||
{
|
||||
<div class="col-md-3">
|
||||
<label class="form-label form-label-sm">Method</label>
|
||||
<select class="form-select form-select-sm" data-test="flow-method-select"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-1")">Method</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" data-test="flow-method-select"
|
||||
@bind="_selectedMethodId" @bind:after="OnMethodChangedAsync" disabled="@_running">
|
||||
<option value="0">— choose —</option>
|
||||
@foreach (var m in _methods)
|
||||
@@ -51,8 +51,8 @@
|
||||
else
|
||||
{
|
||||
<div class="col-md-2">
|
||||
<label class="form-label form-label-sm">Site</label>
|
||||
<select class="form-select form-select-sm" data-test="flow-site-select"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-2")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" data-test="flow-site-select"
|
||||
@bind="_selectedSiteId" @bind:after="OnSiteChangedAsync" disabled="@_running">
|
||||
<option value="0">— choose —</option>
|
||||
@foreach (var s in _sites)
|
||||
@@ -65,7 +65,7 @@
|
||||
name, not a short site name. The script-entry branch still sums to 8 of 12
|
||||
(site 2 + instance 3 + script 3) alongside the auto-width toolbar columns. *@
|
||||
<div class="col-md-3">
|
||||
<label class="form-label form-label-sm">Instance</label>
|
||||
<div class="form-label form-label-sm">Instance</div>
|
||||
@* A site can hold hundreds of instances, so this is the shared area-tree
|
||||
combobox, not a flat list (design 2026-09-08). _areas/_instances are
|
||||
loaded once per site — the picker treats a new list as a site change. *@
|
||||
@@ -75,8 +75,8 @@
|
||||
Placeholder="Search instances…" DataTestPrefix="flow-instance" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label form-label-sm">Script</label>
|
||||
<select class="form-select form-select-sm" data-test="flow-script-select"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-3")">Script</label>
|
||||
<select id="@($"{_fieldScope}-field-3")" class="form-select form-select-sm" data-test="flow-script-select"
|
||||
@bind="_selectedScript" @bind:after="OnScriptChangedAsync" disabled="@(_running || _selectedInstanceId == 0)">
|
||||
<option value="">— choose —</option>
|
||||
@foreach (var s in _scripts)
|
||||
@@ -90,8 +90,8 @@
|
||||
else
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Execution ID</label>
|
||||
<input class="form-control form-control-sm font-monospace" data-test="flow-execution-id"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-4")">Execution ID</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" class="form-control form-control-sm font-monospace" data-test="flow-execution-id"
|
||||
placeholder="any execution id in the chain" @bind="_replayExecutionIdText" disabled="@_running" />
|
||||
</div>
|
||||
}
|
||||
@@ -100,7 +100,7 @@
|
||||
@if (_canLive)
|
||||
{
|
||||
<div class="col-auto">
|
||||
<label class="form-label form-label-sm">Mode</label>
|
||||
<div class="form-label form-label-sm">Mode</div>
|
||||
<div class="btn-group btn-group-sm d-block" role="group" aria-label="Mode">
|
||||
<button type="button" class="btn @(_mode == FlowMode.Live ? "btn-primary" : "btn-outline-secondary")"
|
||||
data-test="flow-mode-live" disabled="@_running" @onclick="() => SetMode(FlowMode.Live)">Live</button>
|
||||
@@ -241,18 +241,18 @@
|
||||
</div>
|
||||
@if (_methodRawMode)
|
||||
{
|
||||
<div data-test="flow-method-raw">
|
||||
<MonacoEditor Language="json" Height="220px" ShowToolbar="false"
|
||||
<div data-test="flow-method-raw" role="group" aria-label="Method request body" aria-describedby="@($"{_fieldScope}-raw-description")">
|
||||
<MonacoEditor AriaLabel="Flow request body JSON" Language="json" Height="220px" ShowToolbar="false"
|
||||
JsonSchema="@MethodRawJsonSchema"
|
||||
Value="@_methodRawText"
|
||||
ValueChanged="@(v => SetMethodRawJson(v))" />
|
||||
@if (_methodRawError is { } rawError)
|
||||
{
|
||||
<div class="text-danger small mt-1" data-test="flow-method-raw-error">@rawError</div>
|
||||
<div id="@($"{_fieldScope}-raw-description")" role="alert" class="text-danger small mt-1" data-test="flow-method-raw-error">@rawError</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="form-text">The whole request body, validated against the method's parameter definitions.</div>
|
||||
<div id="@($"{_fieldScope}-raw-description")" class="form-text">The whole request body, validated against the method's parameter definitions.</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -276,10 +276,10 @@
|
||||
@if (script.IsWriteKind)
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label form-label-sm">New value for <span class="font-monospace">@(script.TriggerAttribute ?? "…")</span></label>
|
||||
<input class="form-control form-control-sm" data-test="flow-input-value"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-5")">New value for <span class="font-monospace">@(script.TriggerAttribute ?? "…")</span></label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-5")" class="form-control form-control-sm" data-test="flow-input-value"
|
||||
@bind="_valueChangeValue" @bind:event="oninput" disabled="@_running" />
|
||||
<div class="form-text">@script.TriggerType trigger — writing the attribute fires the script.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">@script.TriggerType trigger — writing the attribute fires the script.</div>
|
||||
</div>
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(script.ParameterDefinitions))
|
||||
@@ -359,3 +359,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+16
-14
@@ -174,7 +174,7 @@
|
||||
}
|
||||
</span>
|
||||
<span class="text-muted small">@g.Members.Count</span>
|
||||
<select class="form-select form-select-sm" style="width: 160px;" data-test="binding-group-connection"
|
||||
<select aria-label="Binding group connection" class="form-select form-select-sm" style="width: 160px;" data-test="binding-group-connection"
|
||||
value="@GroupConnectionInput(g)"
|
||||
@onchange="e => _groupConnectionInput[g.Key] = int.TryParse(e.Value?.ToString(), out var v) ? v : 0">
|
||||
<option value="0">@(g.ConnectionState == BindingConnectionState.Mixed ? "— mixed —" : "— none —")</option>
|
||||
@@ -183,7 +183,7 @@
|
||||
<option value="@c.Id">@c.Name</option>
|
||||
}
|
||||
</select>
|
||||
<input class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="binding-group-object"
|
||||
<input aria-label="Binding group object reference" class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="binding-group-object"
|
||||
value="@GroupObjectInput(g)"
|
||||
placeholder="@(g.IsObjectMixed ? "mixed — enter object to unify" : "object, e.g. MESReceiver_022")"
|
||||
title="Object path the module's members hang off; Apply rewrites every member to <object>.<member>. Blank clears the overrides."
|
||||
@@ -241,7 +241,7 @@
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm"
|
||||
<select aria-label="Attribute data connection" class="form-select form-select-sm"
|
||||
value="@connId"
|
||||
@onchange="(e) => OnBindingChanged(name, e)">
|
||||
<option value="0">— none —</option>
|
||||
@@ -252,7 +252,7 @@
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control form-control-sm font-monospace"
|
||||
<input aria-label="Attribute source reference" class="form-control form-control-sm font-monospace"
|
||||
value="@GetOverrideForAttr(name)"
|
||||
@onchange="(e) => OnOverrideForAttrChanged(name, e)"
|
||||
placeholder="@(m.Row.DefaultReference ?? "(no default)")" />
|
||||
@@ -407,7 +407,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="Attribute override value" type="text" class="form-control form-control-sm"
|
||||
value="@GetOverrideValue(attr.Name)"
|
||||
@onchange="(e) => OnOverrideChanged(attr.Name, e)" />
|
||||
}
|
||||
@@ -537,10 +537,10 @@
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-1")">
|
||||
Priority override
|
||||
</label>
|
||||
<input type="number" min="0" max="1000" class="form-control form-control-sm"
|
||||
<input id="@($"{_fieldScope}-field-1")" type="number" min="0" max="1000" class="form-control form-control-sm"
|
||||
data-test="alarm-priority-input"
|
||||
placeholder="@_editingAlarm.PriorityLevel"
|
||||
@bind="_editingPriorityText" @bind:event="oninput" />
|
||||
@@ -549,8 +549,8 @@
|
||||
@* Tri-state: blank = inherit the template alarm's flag.
|
||||
"Not reportable" is a real override, not a clear — it
|
||||
pins a reportable template alarm off for this instance. *@
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">MES reportable override</label>
|
||||
<select class="form-select form-select-sm" data-test="alarm-mes-select" @bind="_editingMesReportableText">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-2")">MES reportable override</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" data-test="alarm-mes-select" @bind="_editingMesReportableText">
|
||||
<option value="">Inherited (@(_editingAlarm.IsMesReportable ? "reportable" : "not reportable"))</option>
|
||||
<option value="true">Reportable</option>
|
||||
<option value="false">Not reportable</option>
|
||||
@@ -676,7 +676,7 @@
|
||||
<div class="text-muted font-monospace text-truncate">@src.SourceReference</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm"
|
||||
<select aria-label="Native alarm data connection" class="form-select form-select-sm"
|
||||
value="@(_nasConnEdit.GetValueOrDefault(src.Name) ?? "")"
|
||||
@onchange="e => _nasConnEdit[src.Name] = string.IsNullOrEmpty((string?)e.Value) ? null : (string?)e.Value">
|
||||
<option value="">(inherited)</option>
|
||||
@@ -687,19 +687,19 @@
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control form-control-sm font-monospace"
|
||||
<input aria-label="Native alarm source reference" class="form-control form-control-sm font-monospace"
|
||||
placeholder="@src.SourceReference"
|
||||
value="@(_nasRefEdit.GetValueOrDefault(src.Name) ?? "")"
|
||||
@onchange="e => _nasRefEdit[src.Name] = string.IsNullOrWhiteSpace((string?)e.Value) ? null : ((string?)e.Value)!.Trim()" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Native alarm condition filter" class="form-control form-control-sm"
|
||||
placeholder="@(string.IsNullOrEmpty(src.ConditionFilter) ? "(all)" : src.ConditionFilter)"
|
||||
value="@(_nasFilterEdit.GetValueOrDefault(src.Name) ?? "")"
|
||||
@onchange="e => _nasFilterEdit[src.Name] = string.IsNullOrWhiteSpace((string?)e.Value) ? null : ((string?)e.Value)!.Trim()" />
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm" data-test="@($"nas-mes-{src.Name}")"
|
||||
<select aria-label="Native alarm MES reportable override" class="form-select form-select-sm" data-test="@($"nas-mes-{src.Name}")"
|
||||
value="@MesText(_nasMesEdit.GetValueOrDefault(src.Name))"
|
||||
@onchange="e => _nasMesEdit[src.Name] = ParseMes((string?)e.Value)">
|
||||
<option value="" selected="@(_nasMesEdit.GetValueOrDefault(src.Name) == null)">Inherited (@(src.IsMesReportable ? "reportable" : "not reportable"))</option>
|
||||
@@ -733,7 +733,7 @@
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<select class="form-select form-select-sm" style="width: auto;" data-test="area-select" @bind="_reassignAreaId">
|
||||
<select aria-label="Assigned area" class="form-select form-select-sm" style="width: auto;" data-test="area-select" @bind="_reassignAreaId">
|
||||
<option value="0">No area</option>
|
||||
@foreach (var a in _siteAreas)
|
||||
{
|
||||
@@ -2008,3 +2008,5 @@
|
||||
_ => "bg-secondary"
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+18
-14
@@ -38,13 +38,13 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Instance Name</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_createName" placeholder="e.g. Motor-1" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Instance Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm" @bind="_createName" placeholder="e.g. Motor-1" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Template</label>
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Template</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" data-test="create-template" readonly
|
||||
<input aria-describedby="@(_templates.Count == 0 || _templateHint is not null ? $"{_helpScope}-0" : null)" id="@($"{_fieldScope}-field-2")" type="text" class="form-control" data-test="create-template" readonly
|
||||
placeholder="Choose a template…" value="@TemplatePathLabel"
|
||||
style="cursor: pointer; background-color: var(--bs-body-bg);"
|
||||
@onclick="OpenTemplatePickerAsync" />
|
||||
@@ -53,16 +53,16 @@
|
||||
</div>
|
||||
@if (_templates.Count == 0)
|
||||
{
|
||||
<div class="form-text">No templates exist yet — <a href="/design/templates">create one on the Templates page</a>.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">No templates exist yet — <a href="/design/templates">create one on the Templates page</a>.</div>
|
||||
}
|
||||
else if (_templateHint is not null)
|
||||
{
|
||||
<div class="form-text text-warning-emphasis">@_templateHint</div>
|
||||
<div class="form-text text-warning-emphasis" id="@($"{_helpScope}-0")">@_templateHint</div>
|
||||
}
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Site</label>
|
||||
<select class="form-select form-select-sm" data-test="create-site"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-3")" class="form-select form-select-sm" data-test="create-site"
|
||||
value="@_createSiteId"
|
||||
@onchange="async e => { _createSiteId = int.TryParse(e.Value?.ToString(), out var v) ? v : 0; _createAreaId = 0; await OnTemplateOrSiteChangedAsync(); }">
|
||||
<option value="0">Select site...</option>
|
||||
@@ -73,8 +73,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Area</label>
|
||||
<select class="form-select form-select-sm" @bind="_createAreaId">
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-4")">Area</label>
|
||||
<select id="@($"{_fieldScope}-field-4")" class="form-select form-select-sm" @bind="_createAreaId">
|
||||
<option value="0">No area</option>
|
||||
@foreach (var a in _allAreas.Where(a => a.SiteId == _createSiteId))
|
||||
{
|
||||
@@ -138,14 +138,14 @@
|
||||
{
|
||||
<div class="card-body border-bottom py-2 d-flex align-items-center gap-2 flex-wrap small">
|
||||
<span>Bind all to</span>
|
||||
<select class="form-select form-select-sm" style="width: auto;" data-test="create-root-connection" @bind="_rootConnectionId">
|
||||
<select aria-label="Root data connection" class="form-select form-select-sm" style="width: auto;" data-test="create-root-connection" @bind="_rootConnectionId">
|
||||
<option value="0">Select connection...</option>
|
||||
@foreach (var c in _siteConnections)
|
||||
{
|
||||
<option value="@c.Id">@c.Name (@c.Protocol)</option>
|
||||
}
|
||||
</select>
|
||||
<input class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="create-root-object"
|
||||
<input aria-label="Root object reference" class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="create-root-object"
|
||||
@bind="_rootObject" placeholder="root object, e.g. Z28063" />
|
||||
<button class="btn btn-outline-primary btn-sm" data-test="create-root-browse"
|
||||
disabled="@(!IsBrowsable(_rootConnectionId))" @onclick="() => OpenBrowser(null)">Browse…</button>
|
||||
@@ -169,7 +169,7 @@
|
||||
}
|
||||
</span>
|
||||
<span class="text-muted small">@g.Members.Count</span>
|
||||
<select class="form-select form-select-sm" style="width: 160px;" data-test="create-group-connection"
|
||||
<select aria-label="Binding group connection" class="form-select form-select-sm" style="width: 160px;" data-test="create-group-connection"
|
||||
value="@(input?.ConnectionId ?? 0)"
|
||||
@onchange="e => SetGroupConnection(g, int.TryParse(e.Value?.ToString(), out var v) ? v : 0)">
|
||||
<option value="0">— none —</option>
|
||||
@@ -178,7 +178,7 @@
|
||||
<option value="@c.Id">@c.Name</option>
|
||||
}
|
||||
</select>
|
||||
<input class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="create-group-object"
|
||||
<input aria-label="Binding group object reference" class="form-control form-control-sm font-monospace" style="max-width: 260px;" data-test="create-group-object"
|
||||
value="@input?.Object"
|
||||
placeholder="@(g.IsInstanceGroup ? "object, e.g. Z28063" : $"object, e.g. {g.Key}")"
|
||||
title="Object path this module's members hang off; every member binds as <object>.<member>."
|
||||
@@ -400,3 +400,7 @@
|
||||
await OnTemplateOrSiteChangedAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<button type="button" class="btn-close" @onclick="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<select class="form-select form-select-sm" @bind="_targetParentId">
|
||||
<select aria-label="Parent area" class="form-select form-select-sm" @bind="_targetParentId">
|
||||
@foreach (var opt in ParentOptions)
|
||||
{
|
||||
<option value="@opt.Id">@opt.Label</option>
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<button type="button" class="btn-close" @onclick="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<select class="form-select form-select-sm" @bind="_targetAreaId">
|
||||
<select aria-label="Target area" class="form-select form-select-sm" @bind="_targetAreaId">
|
||||
@foreach (var opt in AreaOptions)
|
||||
{
|
||||
<option value="@opt.Id">@opt.Label</option>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<h4 class="mb-0">Topology</h4>
|
||||
</div>
|
||||
<div class="d-flex align-items-center mb-2 gap-2 flex-wrap">
|
||||
<input type="text" class="form-control form-control-sm" style="max-width: 320px;"
|
||||
<input aria-label="Search loaded sites, areas and instances" type="text" class="form-control form-control-sm" style="max-width: 320px;"
|
||||
placeholder="Search loaded sites, areas, instances..."
|
||||
@bind="_searchText" @bind:event="oninput" @bind:after="OnSearchChanged" />
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Topology actions">
|
||||
|
||||
@@ -39,20 +39,20 @@
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h6">Method</legend>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_name" disabled="@Id.HasValue" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_name" disabled="@Id.HasValue" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<input type="number" class="form-control" @bind="_timeoutSeconds" min="1" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Timeout (seconds)</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="number" class="form-control" @bind="_timeoutSeconds" min="1" />
|
||||
</div>
|
||||
<div class="form-check mb-0">
|
||||
<input class="form-check-input" type="checkbox" id="api-method-trace-all-calls"
|
||||
<input class="form-check-input" type="checkbox" id="api-method-trace-all-calls" aria-describedby="@($"{_fieldScope}-trace-hint")"
|
||||
data-test="api-method-trace-all-calls" @bind="_traceAllCalls" />
|
||||
<label class="form-check-label" for="api-method-trace-all-calls">
|
||||
Trace all calls (Flow Debugger)
|
||||
</label>
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-trace-hint")">
|
||||
Every call to this method records its routed site steps as audit rows the
|
||||
Flow Debugger can replay. Adds 7–10 audit rows per call; for low-volume
|
||||
integration methods.
|
||||
@@ -60,12 +60,12 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-4">
|
||||
<fieldset class="mb-4" aria-describedby="@($"{_fieldScope}-keys-hint")">
|
||||
<legend class="h6">Approved API Keys</legend>
|
||||
<div class="mb-0">
|
||||
@if (_allKeys.Count == 0)
|
||||
{
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-keys-hint")">
|
||||
No API keys configured.
|
||||
<a href="/admin/api-keys">Create one</a> to authorize callers for this method.
|
||||
</div>
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-keys-hint")">
|
||||
Callers must present a checked key in the <code>X-API-Key</code> header to invoke this method.
|
||||
</div>
|
||||
}
|
||||
@@ -100,13 +100,13 @@
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h6">Contract</legend>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Parameters</label>
|
||||
<div class="form-label">Parameters</div>
|
||||
<SchemaBuilder Mode="object"
|
||||
Value="@_params"
|
||||
ValueChanged="@(v => _params = v)" />
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label">Return value</label>
|
||||
<div class="form-label">Return value</div>
|
||||
<SchemaBuilder Mode="value"
|
||||
Value="@_returns"
|
||||
ValueChanged="@(v => _returns = v)" />
|
||||
@@ -116,7 +116,7 @@
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h6">Script</legend>
|
||||
<div class="mb-0">
|
||||
<MonacoEditor @ref="_editor" Value="@_script" ValueChanged="@(v => _script = v)"
|
||||
<MonacoEditor AriaLabel="Inbound API method code" @ref="_editor" Value="@_script" ValueChanged="@(v => _script = v)"
|
||||
Language="csharp" Height="320px"
|
||||
ScriptKind="ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis.ScriptKind.InboundApi"
|
||||
DeclaredParameters="@ScriptParameterNames.Parse(_params)"
|
||||
@@ -216,7 +216,7 @@
|
||||
routing needs a deployed site reachable over the cluster transport.
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Parameter values</label>
|
||||
<div class="form-label small">Parameter values</div>
|
||||
<ParameterValueForm ParameterDefinitions="@_params"
|
||||
Values="_paramValues"
|
||||
ValuesChanged="@(v => _paramValues = v)" />
|
||||
@@ -244,18 +244,18 @@
|
||||
@if (_runResult.Success)
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-success mb-1">
|
||||
<div class="form-label small text-success mb-1">
|
||||
Return value <span class="badge bg-secondary-subtle text-secondary-emphasis ms-1">@_runResult.ReturnTypeName</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="bg-body-secondary border rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ReturnValueJson</pre>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-danger mb-1">
|
||||
<div class="form-label small text-danger mb-1">
|
||||
<span class="badge bg-danger me-1">@ErrorKindLabel(_runResult.ErrorKind)</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="border border-danger-subtle rounded p-2 small mb-0 font-monospace text-danger" style="white-space: pre-wrap;">@_runResult.Error</pre>
|
||||
@if (_runResult.Markers is { Count: > 0 })
|
||||
{
|
||||
@@ -272,7 +272,7 @@
|
||||
@if (!string.IsNullOrEmpty(_runResult.ConsoleOutput))
|
||||
{
|
||||
<div class="mb-0">
|
||||
<label class="form-label small mb-1">Console output</label>
|
||||
<div class="form-label small mb-1">Console output</div>
|
||||
<pre class="bg-dark text-light rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ConsoleOutput</pre>
|
||||
</div>
|
||||
}
|
||||
@@ -532,3 +532,5 @@
|
||||
_ => "Error"
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+28
-21
@@ -35,18 +35,18 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Site</label>
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Site</label>
|
||||
@if (_siteLocked)
|
||||
{
|
||||
<input type="text"
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-1")" type="text"
|
||||
class="form-control form-control-plaintext form-control-sm"
|
||||
readonly
|
||||
value="@_siteName" />
|
||||
<div class="form-text">Site is locked after creation.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Site is locked after creation.</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select form-select-sm" @bind="_formSiteId">
|
||||
<select id="@($"{_fieldScope}-field-1")" aria-label="Site" class="form-select form-select-sm" @bind="_formSiteId">
|
||||
<option value="0">Select site...</option>
|
||||
@foreach (var site in _sites)
|
||||
{
|
||||
@@ -56,37 +56,37 @@
|
||||
}
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Protocol</label>
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Protocol</label>
|
||||
@if (_protocolLocked)
|
||||
{
|
||||
<input type="text"
|
||||
<input aria-describedby="@($"{_helpScope}-1")" id="@($"{_fieldScope}-field-2")" type="text"
|
||||
class="form-control form-control-plaintext form-control-sm"
|
||||
readonly
|
||||
value="@_protocol" />
|
||||
<div class="form-text">Protocol is locked after creation.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-1")">Protocol is locked after creation.</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select form-select-sm" @bind="_protocol">
|
||||
<select id="@($"{_fieldScope}-field-2")" aria-label="Protocol" class="form-select form-select-sm" @bind="_protocol">
|
||||
<option value="OpcUa">OPC UA</option>
|
||||
<option value="MxGateway">MxGateway</option>
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Name</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formName" />
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-3")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="text" class="form-control form-control-sm" @bind="_formName" />
|
||||
</div>
|
||||
|
||||
@if (Id.HasValue && _protocol == "OpcUa")
|
||||
{
|
||||
<div class="mb-2">
|
||||
<a class="btn btn-outline-secondary btn-sm"
|
||||
data-test="manage-certificates-link"
|
||||
data-test="manage-certificates-link" aria-describedby="@($"{_helpScope}-certificate-hint")"
|
||||
href="@($"/design/connections/{Id}/certificates")">
|
||||
Manage certificates
|
||||
</a>
|
||||
<div class="form-text">
|
||||
<div id="@($"{_helpScope}-certificate-hint")" class="form-text">
|
||||
View, trust, and remove OPC UA server certificates in the
|
||||
site's node-wide trusted-peer store.
|
||||
</div>
|
||||
@@ -160,22 +160,22 @@
|
||||
Errors="_backupErrors" />
|
||||
}
|
||||
<div class="mb-2">
|
||||
<label class="form-label small">Failover Retry Count</label>
|
||||
<input type="number" class="form-control form-control-sm" style="max-width: 120px;"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-4")">Failover Retry Count</label>
|
||||
<input aria-describedby="@($"{_helpScope}-2")" id="@($"{_fieldScope}-field-4")" type="number" class="form-control form-control-sm" style="max-width: 120px;"
|
||||
min="1" max="20" @bind="_formFailoverRetryCount" />
|
||||
<div class="form-text">Retries before failing over to backup endpoint.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-2")">Retries before failing over to backup endpoint.</div>
|
||||
</div>
|
||||
@if (_protocol != "MxGateway")
|
||||
{
|
||||
<div class="mb-2" data-test="servicelevel-failover">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="sl-failover-enabled"
|
||||
<input type="checkbox" class="form-check-input" id="sl-failover-enabled" aria-describedby="@($"{_helpScope}-servicelevel")"
|
||||
@bind="_formSlEnabled" />
|
||||
<label class="form-check-label small" for="sl-failover-enabled">
|
||||
ServiceLevel failover
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-servicelevel")">
|
||||
Fail over when the connected endpoint's ServiceLevel stays below 200 (Degraded)
|
||||
for the window below and the other endpoint reports a Healthy (200+), higher level.
|
||||
Needed for an OtOpcUa pair in Warm redundancy; a 250/240 pair never triggers it.
|
||||
@@ -185,13 +185,13 @@
|
||||
<div class="row g-2 mt-1">
|
||||
<div class="col-auto">
|
||||
<label class="form-label small" for="sl-failover-window">Degraded window (s)</label>
|
||||
<input type="number" id="sl-failover-window" class="form-control form-control-sm"
|
||||
<input aria-invalid="@(PrimaryError("ServiceLevelFailover.DegradedWindowSeconds") is not null ? "true" : "false")" aria-describedby="@(PrimaryError("ServiceLevelFailover.DegradedWindowSeconds") is not null ? PrimaryErrorId("ServiceLevelFailover.DegradedWindowSeconds") : null)" type="number" id="sl-failover-window" class="form-control form-control-sm"
|
||||
style="max-width: 120px;" min="1" max="3600" @bind="_formSlWindowSeconds" />
|
||||
@RenderPrimaryError("ServiceLevelFailover.DegradedWindowSeconds")
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label small" for="sl-failover-dwell">Minimum dwell (s)</label>
|
||||
<input type="number" id="sl-failover-dwell" class="form-control form-control-sm"
|
||||
<input aria-invalid="@(PrimaryError("ServiceLevelFailover.MinDwellSeconds") is not null ? "true" : "false")" aria-describedby="@(PrimaryError("ServiceLevelFailover.MinDwellSeconds") is not null ? PrimaryErrorId("ServiceLevelFailover.MinDwellSeconds") : null)" type="number" id="sl-failover-dwell" class="form-control form-control-sm"
|
||||
style="max-width: 120px;" min="0" max="86400" @bind="_formSlDwellSeconds" />
|
||||
@RenderPrimaryError("ServiceLevelFailover.MinDwellSeconds")
|
||||
</div>
|
||||
@@ -406,13 +406,20 @@
|
||||
_formSlDwellSeconds = OpcUaServiceLevelFailoverConfig.DefaultMinDwellSeconds;
|
||||
}
|
||||
|
||||
private ValidationEntry? PrimaryError(string field) => _primaryErrors?.Errors.FirstOrDefault(e => e.EntityName == "Primary." + field);
|
||||
private string PrimaryErrorId(string field) => _fieldScope + "-primary-error-" + field.Replace('.', '-');
|
||||
|
||||
private RenderFragment? RenderPrimaryError(string field)
|
||||
{
|
||||
var match = _primaryErrors?.Errors.FirstOrDefault(e => e.EntityName == "Primary." + field);
|
||||
var match = PrimaryError(field);
|
||||
return match is null
|
||||
? null
|
||||
: @<div class="text-danger small">@match.Message</div>;
|
||||
: @<div id="@PrimaryErrorId(field)" role="alert" class="text-danger small">@match.Message</div>;
|
||||
}
|
||||
|
||||
private void GoBack() => NavigationManager.NavigateTo("/design/connections");
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="Search sites or connections" type="text" class="form-control form-control-sm"
|
||||
placeholder="Search sites or connections..."
|
||||
@bind="_searchText" @bind:event="oninput" @bind:after="OnSearchChanged" />
|
||||
</div>
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_name" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_name" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Connection String</label>
|
||||
<input type="text" class="form-control" @bind="_connectionString" />
|
||||
<div class="form-text">Treat as sensitive — visible to admins only.</div>
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Connection String</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-2")" type="text" class="form-control" @bind="_connectionString" />
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Treat as sensitive — visible to admins only.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Max Retries</label>
|
||||
<input type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Max Retries</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Retry Delay (seconds)</label>
|
||||
<input type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-4")">Retry Delay (seconds)</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
</div>
|
||||
|
||||
@if (_formError != null)
|
||||
@@ -107,3 +107,7 @@
|
||||
|
||||
private void GoBack() => NavigationManager.NavigateTo("/design/external-systems");
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+19
-15
@@ -37,38 +37,38 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_name" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_name" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Endpoint URL</label>
|
||||
<input type="text" class="form-control" @bind="_endpointUrl" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Endpoint URL</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control" @bind="_endpointUrl" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Auth Type</label>
|
||||
<select class="form-select" @bind="_authType">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Auth Type</label>
|
||||
<select id="@($"{_fieldScope}-field-3")" class="form-select" @bind="_authType">
|
||||
<option>ApiKey</option>
|
||||
<option>BasicAuth</option>
|
||||
<option>None</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Auth Config (JSON)</label>
|
||||
<input type="text" class="form-control" @bind="_authConfig"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-4")">Auth Config (JSON)</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" type="text" class="form-control" @bind="_authConfig"
|
||||
placeholder="@_authConfigPlaceholder" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Max Retries</label>
|
||||
<input type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-5")">Max Retries</label>
|
||||
<input id="@($"{_fieldScope}-field-5")" type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Retry Delay (seconds)</label>
|
||||
<input type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-6")">Retry Delay (seconds)</label>
|
||||
<input id="@($"{_fieldScope}-field-6")" type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<input type="number" class="form-control" @bind="_timeoutSeconds" min="0" />
|
||||
<div class="form-text">0 = use gateway default</div>
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-7")">Timeout (seconds)</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-7")" type="number" class="form-control" @bind="_timeoutSeconds" min="0" />
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">0 = use gateway default</div>
|
||||
</div>
|
||||
|
||||
@if (_formError != null)
|
||||
@@ -150,3 +150,7 @@
|
||||
|
||||
private void GoBack() => NavigationManager.NavigateTo("/design/external-systems");
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter external systems" class="form-control form-control-sm"
|
||||
placeholder="Filter by name…"
|
||||
@bind="_extsysSearch" @bind:event="oninput" />
|
||||
</div>
|
||||
@@ -217,7 +217,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter database connections" class="form-control form-control-sm"
|
||||
placeholder="Filter by name…"
|
||||
@bind="_dbConnSearch" @bind:event="oninput" />
|
||||
</div>
|
||||
@@ -290,7 +290,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter API methods" class="form-control form-control-sm"
|
||||
placeholder="Filter by name…"
|
||||
@bind="_apiMethodSearch" @bind:event="oninput" />
|
||||
</div>
|
||||
|
||||
@@ -30,19 +30,19 @@
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small">Name</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm"
|
||||
placeholder="e.g. Address" @bind="_formName" />
|
||||
<div class="form-text">Referenced as <code>lib:@(string.IsNullOrWhiteSpace(_formName) ? "Name" : _formName.Trim())</code>.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Referenced as <code>lib:@(string.IsNullOrWhiteSpace(_formName) ? "Name" : _formName.Trim())</code>.</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small">Scope <span class="text-muted">(optional)</span></label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-2")">Scope <span class="text-muted">(optional)</span></label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control form-control-sm"
|
||||
placeholder="(global)" @bind="_formScope" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="form-label small">Schema</label>
|
||||
<div class="form-label small">Schema</div>
|
||||
<SchemaBuilder Mode="value"
|
||||
Value="@_formSchemaJson"
|
||||
ValueChanged="@(v => _formSchemaJson = v)" />
|
||||
@@ -249,3 +249,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Name</label>
|
||||
<input type="text" class="form-control form-control-sm" @bind="_formName"
|
||||
<label class="form-label small" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control form-control-sm" @bind="_formName"
|
||||
disabled="@(Id.HasValue)" />
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</ul>
|
||||
<div class="border border-top-0 rounded-bottom p-3">
|
||||
<div style="display: @(_formTab == "code" ? "block" : "none")">
|
||||
<MonacoEditor @ref="_editor" Value="@_formCode" ValueChanged="@(v => _formCode = v)"
|
||||
<MonacoEditor AriaLabel="Shared script code" @ref="_editor" Value="@_formCode" ValueChanged="@(v => _formCode = v)"
|
||||
Language="csharp" Height="320px"
|
||||
DeclaredParameters="@ScriptParameterNames.Parse(_formParameters)"
|
||||
DeclaredParameterShapes="@ScriptParameterNames.ParseShapes(_formParameters)"
|
||||
@@ -115,7 +115,7 @@
|
||||
<code>Attributes</code> and <code>CallScript</code> still throw.
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Parameter values</label>
|
||||
<div class="form-label small">Parameter values</div>
|
||||
<ParameterValueForm ParameterDefinitions="@_formParameters"
|
||||
Values="_paramValues"
|
||||
ValuesChanged="@(v => _paramValues = v)" />
|
||||
@@ -143,18 +143,18 @@
|
||||
@if (_runResult.Success)
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-success mb-1">
|
||||
<div class="form-label small text-success mb-1">
|
||||
Return value <span class="badge bg-secondary-subtle text-secondary-emphasis ms-1">@_runResult.ReturnTypeName</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="bg-body-secondary border rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ReturnValueJson</pre>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-danger mb-1">
|
||||
<div class="form-label small text-danger mb-1">
|
||||
<span class="badge bg-danger me-1">@ErrorKindLabel(_runResult.ErrorKind)</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="border border-danger-subtle rounded p-2 small mb-0 font-monospace text-danger" style="white-space: pre-wrap;">@_runResult.Error</pre>
|
||||
@if (_runResult.Markers is { Count: > 0 })
|
||||
{
|
||||
@@ -171,7 +171,7 @@
|
||||
@if (!string.IsNullOrEmpty(_runResult.ConsoleOutput))
|
||||
{
|
||||
<div class="mb-0">
|
||||
<label class="form-label small mb-1">Console output</label>
|
||||
<div class="form-label small mb-1">Console output</div>
|
||||
<pre class="bg-dark text-light rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ConsoleOutput</pre>
|
||||
</div>
|
||||
}
|
||||
@@ -381,3 +381,5 @@
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
else
|
||||
{
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<input class="form-control form-control-sm"
|
||||
<input aria-label="Filter shared scripts" class="form-control form-control-sm"
|
||||
placeholder="Filter by name or code…"
|
||||
@bind="_search" @bind:event="oninput" />
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -28,7 +28,7 @@
|
||||
<input id="alarm-priority" type="number" class="form-control" @bind="_priority" min="0" max="1000" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Trigger Configuration</label>
|
||||
<div class="form-label">Trigger Configuration</div>
|
||||
<AlarmTriggerEditor TriggerType="@_triggerType"
|
||||
Value="@_triggerConfig"
|
||||
ValueChanged="@(v => _triggerConfig = v)"
|
||||
@@ -43,9 +43,9 @@
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" @bind="_isMesReportable" id="alarmMesReportable" />
|
||||
<input class="form-check-input" type="checkbox" @bind="_isMesReportable" id="alarmMesReportable" aria-describedby="alarm-mes-hint" />
|
||||
<label class="form-check-label" for="alarmMesReportable">MES reportable</label>
|
||||
<div class="form-text">Returned by the MES alarm-status API as <code>IsFlaggedForMES</code>. Instances can override this unless the alarm is locked.</div>
|
||||
<div id="alarm-mes-hint" class="form-text">Returned by the MES alarm-status API as <code>IsFlaggedForMES</code>. Instances can override this unless the alarm is locked.</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (_error != null)
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="attr-data-type">Data Type</label>
|
||||
<select id="attr-data-type" class="form-select" value="@_dataType" @onchange="OnDataTypeChanged" disabled="@Editing">
|
||||
<select aria-describedby="@(Editing ? "attr-type-hint" : null)" id="attr-data-type" class="form-select" value="@_dataType" @onchange="OnDataTypeChanged" disabled="@Editing">
|
||||
@foreach (var dt in Enum.GetValues<DataType>())
|
||||
{
|
||||
<option value="@dt">@dt</option>
|
||||
@@ -29,7 +29,7 @@
|
||||
</select>
|
||||
@if (Editing)
|
||||
{
|
||||
<div class="form-text">Data type is fixed once the attribute is created.</div>
|
||||
<div id="attr-type-hint" class="form-text">Data type is fixed once the attribute is created.</div>
|
||||
}
|
||||
</div>
|
||||
@if (_dataType == DataType.List)
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_createName" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_createName" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Parent Template</label>
|
||||
<select class="form-select" @bind="_createParentId">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Parent Template</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select" @bind="_createParentId">
|
||||
<option value="0">(None - root template)</option>
|
||||
@foreach (var t in _templates)
|
||||
{
|
||||
@@ -42,8 +42,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<input type="text" class="form-control" @bind="_createDescription" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Description</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="text" class="form-control" @bind="_createDescription" />
|
||||
</div>
|
||||
@if (_formError != null)
|
||||
{
|
||||
@@ -125,3 +125,5 @@
|
||||
private Task<string> GetCurrentUserAsync()
|
||||
=> AuthStateProvider.RequireRoleAsync(ZB.MOM.WW.ScadaBridge.Security.Roles.Designer);
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -355,12 +355,12 @@
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-12">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_editName" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_editName" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Description</label>
|
||||
<input type="text" class="form-control" @bind="_editDescription" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Description</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control" @bind="_editDescription" />
|
||||
</div>
|
||||
@* Parent template is shown in the header above (the "inherits"
|
||||
/ "Derived from" line), so it is not repeated here. *@
|
||||
@@ -746,7 +746,7 @@
|
||||
{
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch"
|
||||
<input aria-label="Lock attribute in derived templates" class="form-check-input" type="checkbox" role="switch"
|
||||
checked="@attr.LockedInDerived"
|
||||
@onchange="(e) => ToggleAttrLockedInDerived(attr, e)" />
|
||||
</div>
|
||||
@@ -1214,7 +1214,7 @@
|
||||
{
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch"
|
||||
<input aria-label="Lock script in derived templates" class="form-check-input" type="checkbox" role="switch"
|
||||
checked="@script.LockedInDerived"
|
||||
@onchange="(e) => ToggleScriptLockedInDerived(script, e)" />
|
||||
</div>
|
||||
@@ -1794,3 +1794,5 @@
|
||||
_ => "Object"
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+22
-18
@@ -73,15 +73,15 @@
|
||||
@if (ScriptTriggerConfigCodec.SupportsMinTimeBetweenRuns(_triggerType))
|
||||
{
|
||||
<div class="mt-3">
|
||||
<label class="form-label">Min time between runs</label>
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Min time between runs</label>
|
||||
<div class="row g-2" style="max-width: 420px;">
|
||||
<div class="col-7">
|
||||
<input type="number" min="1" step="1" class="form-control"
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-1")" type="number" min="1" step="1" class="form-control"
|
||||
placeholder="(optional)"
|
||||
@bind="_minTimeValue" @bind:event="oninput" />
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<select class="form-select" @bind="_minTimeUnit">
|
||||
<select aria-label="Minimum run interval unit" class="form-select" @bind="_minTimeUnit">
|
||||
<option value="ms">milliseconds</option>
|
||||
<option value="sec">seconds</option>
|
||||
<option value="min">minutes</option>
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
@if (TriggerIsWhileTrue())
|
||||
{
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">
|
||||
This is the re-fire interval for the
|
||||
<strong>WhileTrue</strong> trigger above.
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">
|
||||
Optional throttle — skips trigger invocations that fire
|
||||
sooner than this.
|
||||
</div>
|
||||
@@ -112,21 +112,21 @@
|
||||
</div>
|
||||
}
|
||||
<div class="mt-3">
|
||||
<label class="form-label">Execution timeout</label>
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Execution timeout</label>
|
||||
<div class="input-group" style="max-width: 280px;">
|
||||
<input type="number" min="1" step="1" class="form-control"
|
||||
<input aria-describedby="@($"{_helpScope}-2")" id="@($"{_fieldScope}-field-2")" type="number" min="1" step="1" class="form-control"
|
||||
placeholder="(site default)"
|
||||
@bind="_executionTimeoutSeconds" @bind:event="oninput" />
|
||||
<span class="input-group-text">seconds</span>
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-2")">
|
||||
Per-script execution timeout. Leave blank (or 0) to use the
|
||||
site's global default.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: @(_tab == "code" ? "block" : "none")">
|
||||
<MonacoEditor @ref="_editor" Value="@_code" ValueChanged="@(v => _code = v)"
|
||||
<MonacoEditor AriaLabel="Template script code" @ref="_editor" Value="@_code" ValueChanged="@(v => _code = v)"
|
||||
Language="csharp" Height="360px"
|
||||
DeclaredParameters="@ScriptParameterNames.Parse(_parameters)"
|
||||
DeclaredParameterShapes="@ScriptParameterNames.ParseShapes(_parameters)"
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Bind to instance <span class="text-muted">(optional)</span></label>
|
||||
<div class="form-label small">Bind to instance <span class="text-muted">(optional)</span></div>
|
||||
@if (DeployedInstances.Count == 0)
|
||||
{
|
||||
<div class="form-text">
|
||||
@@ -180,14 +180,14 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select form-select-sm" @bind="_bindInstance">
|
||||
<select aria-describedby="@($"{_helpScope}-3")" aria-label="Bound instance" class="form-select form-select-sm" @bind="_bindInstance">
|
||||
<option value="">— None (Instance/Attributes throw) —</option>
|
||||
@foreach (var inst in DeployedInstances)
|
||||
{
|
||||
<option value="@inst.UniqueName">@inst.UniqueName</option>
|
||||
}
|
||||
</select>
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-3")">
|
||||
Routes <code>Instance.GetAttribute/SetAttribute</code>,
|
||||
<code>Attributes</code>, <code>Children</code>, <code>Parent</code>, and
|
||||
<code>CallScript</code> to the selected live instance.
|
||||
@@ -195,7 +195,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small">Parameter values</label>
|
||||
<div class="form-label small">Parameter values</div>
|
||||
<ParameterValueForm ParameterDefinitions="@_parameters"
|
||||
Values="_paramValues"
|
||||
ValuesChanged="@(v => _paramValues = v)" />
|
||||
@@ -223,18 +223,18 @@
|
||||
@if (_runResult.Success)
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-success mb-1">
|
||||
<div class="form-label small text-success mb-1">
|
||||
Return value <span class="badge bg-secondary-subtle text-secondary-emphasis ms-1">@_runResult.ReturnTypeName</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="bg-body-secondary border rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ReturnValueJson</pre>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-danger mb-1">
|
||||
<div class="form-label small text-danger mb-1">
|
||||
<span class="badge bg-danger me-1">@ScriptErrorKindLabel(_runResult.ErrorKind)</span>
|
||||
</label>
|
||||
</div>
|
||||
<pre class="border border-danger-subtle rounded p-2 small mb-0 font-monospace text-danger" style="white-space: pre-wrap;">@_runResult.Error</pre>
|
||||
@if (_runResult.Markers is { Count: > 0 })
|
||||
{
|
||||
@@ -251,7 +251,7 @@
|
||||
@if (!string.IsNullOrEmpty(_runResult.ConsoleOutput))
|
||||
{
|
||||
<div class="mb-0">
|
||||
<label class="form-label small mb-1">Console output</label>
|
||||
<div class="form-label small mb-1">Console output</div>
|
||||
<pre class="bg-dark text-light rounded p-2 small mb-0 font-monospace" style="white-space: pre-wrap;">@_runResult.ConsoleOutput</pre>
|
||||
</div>
|
||||
}
|
||||
@@ -492,3 +492,7 @@
|
||||
bool IsLocked,
|
||||
int? ExecutionTimeoutSeconds);
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
<div class="mb-3" style="max-width: 320px;">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="Search templates" type="text" class="form-control form-control-sm"
|
||||
placeholder="Search templates..."
|
||||
value="@_searchText"
|
||||
@oninput="e => _searchText = e.Value?.ToString() ?? string.Empty" />
|
||||
|
||||
@@ -456,26 +456,26 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="passphrase" class="form-label">Passphrase</label>
|
||||
<input id="passphrase" type="password" class="form-control"
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="passphrase" type="password" class="form-control"
|
||||
autocomplete="new-password"
|
||||
@bind="_passphrase" @bind:event="oninput" />
|
||||
<div class="progress mt-1" style="height: 4px;">
|
||||
<div class="progress-bar @strengthColor"
|
||||
role="progressbar"
|
||||
role="progressbar" aria-label="Passphrase strength"
|
||||
style="width: @(strength * 25)%;"
|
||||
aria-valuenow="@(strength * 25)" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="form-text">Strength: @strengthLabel · minimum 8 characters.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Strength: @strengthLabel · minimum 8 characters.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="passphrase-confirm" class="form-label">Confirm passphrase</label>
|
||||
<input id="passphrase-confirm" type="password" class="form-control"
|
||||
<input aria-invalid="@(!string.IsNullOrEmpty(_passphraseConfirm) && _passphrase != _passphraseConfirm ? "true" : "false")" aria-describedby="@(!string.IsNullOrEmpty(_passphraseConfirm) && _passphrase != _passphraseConfirm ? $"{_helpScope}-confirm-error" : null)" id="passphrase-confirm" type="password" class="form-control"
|
||||
autocomplete="new-password"
|
||||
@bind="_passphraseConfirm" @bind:event="oninput" />
|
||||
@if (!string.IsNullOrEmpty(_passphraseConfirm) && _passphrase != _passphraseConfirm)
|
||||
{
|
||||
<div class="form-text text-danger">Passphrases do not match.</div>
|
||||
<div id="@($"{_helpScope}-confirm-error")" role="alert" class="form-text text-danger">Passphrases do not match.</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -575,3 +575,5 @@
|
||||
return $"{bytes / (1024.0 * 1024.0):0.00} MB";
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -87,9 +87,9 @@
|
||||
size hint already say what belongs here. *@
|
||||
<div class="mb-3">
|
||||
<label for="bundle-input" class="form-label">Bundle file</label>
|
||||
<InputFile id="bundle-input" OnChange="OnFileSelectedAsync"
|
||||
<InputFile aria-describedby="bundle-size-hint" id="bundle-input" OnChange="OnFileSelectedAsync"
|
||||
class="form-control" accept=".scadabundle,application/zip" />
|
||||
<div class="form-text">
|
||||
<div id="bundle-size-hint" class="form-text">
|
||||
Maximum bundle size: @Options.Value.MaxBundleSizeMb MB.
|
||||
</div>
|
||||
</div>
|
||||
@@ -362,7 +362,7 @@
|
||||
<td><code>@rsm.SourceSiteIdentifier</code></td>
|
||||
<td><span class="cell-clip" title="@rsm.SourceSiteName">@rsm.SourceSiteName</span></td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm"
|
||||
<select aria-label="Target data connection" class="form-select form-select-sm"
|
||||
style="max-width: 22rem;"
|
||||
data-testid="@($"map-site-select-{rsm.SourceSiteIdentifier}")"
|
||||
value="@chosen"
|
||||
@@ -412,7 +412,7 @@
|
||||
<tr data-testid="map-conn-row">
|
||||
<td><span class="cell-clip" title="@rcm.SourceConnectionName">@rcm.SourceConnectionName</span></td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm"
|
||||
<select aria-label="Target data connection" class="form-select form-select-sm"
|
||||
style="max-width: 22rem;"
|
||||
data-testid="@($"map-conn-select-{rcm.SourceSiteIdentifier}-{rcm.SourceConnectionName}")"
|
||||
value="@chosenConn"
|
||||
@@ -492,7 +492,7 @@
|
||||
}
|
||||
@if (current.Action == ResolutionAction.Rename)
|
||||
{
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="Imported item name" type="text" class="form-control form-control-sm"
|
||||
style="max-width: 14rem;"
|
||||
placeholder="New name"
|
||||
value="@(current.RenameTo ?? string.Empty)"
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
@if (_trendSiteKeys.Count > 0)
|
||||
{
|
||||
@* OnTrendSiteChangedAsync is async — Blazor wraps it in an EventCallback so the returned Task IS awaited; keep the Async signature, do not change it to a void/fire-and-forget handler. This comment MUST stay OUTSIDE the <select> start tag: a Razor comment placed between attributes renders as an invalid attribute name and crashes the SignalR circuit (InvalidCharacterError on setAttribute). *@
|
||||
<select class="form-select form-select-sm" style="width:auto"
|
||||
<select aria-label="Site for health trends" class="form-select form-select-sm" style="width:auto"
|
||||
data-test="site-health-trends-site"
|
||||
value="@_trendSiteId"
|
||||
@onchange="OnTrendSiteChangedAsync">
|
||||
|
||||
+12
-10
@@ -26,16 +26,16 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_name" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_name" />
|
||||
</div>
|
||||
|
||||
@* Type is create-only: a list's channel fixes which contact field its
|
||||
recipients carry (email vs phone), so changing it after recipients exist
|
||||
would orphan them. Disabled on edit (Id.HasValue). *@
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Type</label>
|
||||
<select class="form-select" @bind="_type" disabled="@Id.HasValue">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">Type</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select" @bind="_type" disabled="@Id.HasValue">
|
||||
@foreach (var channel in ChannelCatalog.SupportedChannels)
|
||||
{
|
||||
<option value="@channel">@ChannelLabel(channel)</option>
|
||||
@@ -62,24 +62,24 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" @bind="_recipientName" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Name</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="text" class="form-control" @bind="_recipientName" />
|
||||
</div>
|
||||
@* Per-type contact field: email lists collect an email address; SMS
|
||||
lists collect an E.164 phone number. *@
|
||||
@if (_type == NotificationType.Sms)
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Phone</label>
|
||||
<input type="tel" class="form-control" placeholder="+15551234567"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-4")">Phone</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" type="tel" class="form-control" placeholder="+15551234567"
|
||||
@bind="_recipientPhone" />
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" class="form-control" @bind="_recipientEmail" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-5")">Email</label>
|
||||
<input id="@($"{_fieldScope}-field-5")" type="email" class="form-control" @bind="_recipientEmail" />
|
||||
</div>
|
||||
}
|
||||
@if (_recipientFormError != null)
|
||||
@@ -262,3 +262,5 @@
|
||||
|
||||
private void GoBack() => NavigationManager.NavigateTo("/notifications/lists");
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+23
-19
@@ -81,30 +81,30 @@
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-12">
|
||||
<label class="form-label">Account SID</label>
|
||||
<input type="text" class="form-control" @bind="_accountSid" placeholder="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Account SID</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="text" class="form-control" @bind="_accountSid" placeholder="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">From Number</label>
|
||||
<input type="text" class="form-control" @bind="_fromNumber" placeholder="+15551234567" />
|
||||
<div class="form-text">Provide a From Number or a Messaging Service SID (at least one is required).</div>
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">From Number</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-2")" type="text" class="form-control" @bind="_fromNumber" placeholder="+15551234567" />
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Provide a From Number or a Messaging Service SID (at least one is required).</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Messaging Service SID</label>
|
||||
<input type="text" class="form-control" @bind="_messagingServiceSid"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Messaging Service SID</label>
|
||||
<input aria-describedby="@($"{_helpScope}-1")" id="@($"{_fieldScope}-field-3")" type="text" class="form-control" @bind="_messagingServiceSid"
|
||||
placeholder="MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (optional)" />
|
||||
<div class="form-text">Optional — used instead of the From number when set.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-1")">Optional — used instead of the From number when set.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">API Base URL</label>
|
||||
<input type="text" class="form-control" @bind="_apiBaseUrl"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-4")">API Base URL</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" type="text" class="form-control" @bind="_apiBaseUrl"
|
||||
placeholder="Leave blank to use the provider default" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Auth Token</label>
|
||||
<input type="password" class="form-control" @bind="_authToken"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-5")">Auth Token</label>
|
||||
<input aria-describedby="@($"{_helpScope}-2")" id="@($"{_fieldScope}-field-5")" type="password" class="form-control" @bind="_authToken"
|
||||
placeholder="@(_editingSms != null ? "Leave blank to keep the stored token" : "Twilio Auth Token")" />
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_helpScope}-2")">
|
||||
Treat as sensitive — visible to admins only.
|
||||
@if (_editingSms != null)
|
||||
{
|
||||
@@ -113,16 +113,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Connection Timeout (s)</label>
|
||||
<input type="number" class="form-control" @bind="_connectionTimeoutSeconds" min="1" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-6")">Connection Timeout (s)</label>
|
||||
<input id="@($"{_fieldScope}-field-6")" type="number" class="form-control" @bind="_connectionTimeoutSeconds" min="1" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Max Retries</label>
|
||||
<input type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-7")">Max Retries</label>
|
||||
<input id="@($"{_fieldScope}-field-7")" type="number" class="form-control" @bind="_maxRetries" min="0" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Retry Delay (s)</label>
|
||||
<input type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-8")">Retry Delay (s)</label>
|
||||
<input id="@($"{_fieldScope}-field-8")" type="number" class="form-control" @bind="_retryDelaySeconds" min="0" />
|
||||
</div>
|
||||
@if (_formError != null)
|
||||
{
|
||||
@@ -270,3 +270,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+25
-21
@@ -106,33 +106,33 @@
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Transport</label>
|
||||
<select class="form-select" @bind="Transport">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Transport</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select" @bind="Transport">
|
||||
<option>Smtp</option>
|
||||
<option>Ews</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">@(IsEwsForm ? "EWS URL" : "Host")</label>
|
||||
<input type="text" class="form-control" @bind="_host"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-2")">@(IsEwsForm ? "EWS URL" : "Host")</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control" @bind="_host"
|
||||
placeholder="@(IsEwsForm ? "https://mail.example.com/ews/exchange.asmx" : "smtp.example.com")" />
|
||||
</div>
|
||||
@if (!IsEwsForm)
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Port</label>
|
||||
<input type="number" class="form-control" @bind="_port" min="1" max="65535" />
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-3")">Port</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="number" class="form-control" @bind="_port" min="1" max="65535" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Auth Type</label>
|
||||
<select class="form-select" @bind="_authType">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-4")">Auth Type</label>
|
||||
<select id="@($"{_fieldScope}-field-4")" class="form-select" @bind="_authType">
|
||||
<option>OAuth2</option>
|
||||
<option>Basic</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">TLS Mode</label>
|
||||
<select class="form-select" @bind="_tlsMode">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-5")">TLS Mode</label>
|
||||
<select id="@($"{_fieldScope}-field-5")" class="form-select" @bind="_tlsMode">
|
||||
<option>None</option>
|
||||
<option>StartTLS</option>
|
||||
<option>SSL</option>
|
||||
@@ -140,29 +140,29 @@
|
||||
</div>
|
||||
}
|
||||
<div class="col-12">
|
||||
<label class="form-label">Credentials</label>
|
||||
<input type="password" class="form-control" @bind="_credentials"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-6")">Credentials</label>
|
||||
<input aria-describedby="@($"{_helpScope}-0")" id="@($"{_fieldScope}-field-6")" type="password" class="form-control" @bind="_credentials"
|
||||
placeholder="@(IsEwsForm ? @"domain\username:password" : "OAuth2 client secret or SMTP password")" />
|
||||
<div class="form-text">Treat as sensitive — visible to admins only.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-0")">Treat as sensitive — visible to admins only.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">From Address</label>
|
||||
<input type="email" class="form-control" @bind="_fromAddress"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-7")">From Address</label>
|
||||
<input id="@($"{_fieldScope}-field-7")" type="email" class="form-control" @bind="_fromAddress"
|
||||
placeholder="noreply@example.com" />
|
||||
</div>
|
||||
@if (_authType == "OAuth2")
|
||||
{
|
||||
<div class="col-12">
|
||||
<label class="form-label">OAuth2 Authority</label>
|
||||
<input type="text" class="form-control" @bind="_oauth2Authority"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-8")">OAuth2 Authority</label>
|
||||
<input aria-describedby="@($"{_helpScope}-1")" id="@($"{_fieldScope}-field-8")" type="text" class="form-control" @bind="_oauth2Authority"
|
||||
placeholder="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token" />
|
||||
<div class="form-text">Token-endpoint URL; leave blank for the Microsoft 365 default. A <code>{tenant}</code> placeholder is substituted from the credential.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-1")">Token-endpoint URL; leave blank for the Microsoft 365 default. A <code>{tenant}</code> placeholder is substituted from the credential.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">OAuth2 Scope</label>
|
||||
<input type="text" class="form-control" @bind="_oauth2Scope"
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-9")">OAuth2 Scope</label>
|
||||
<input aria-describedby="@($"{_helpScope}-2")" id="@($"{_fieldScope}-field-9")" type="text" class="form-control" @bind="_oauth2Scope"
|
||||
placeholder="https://outlook.office365.com/.default" />
|
||||
<div class="form-text">Scope requested from the token endpoint; leave blank for the Microsoft 365 default.</div>
|
||||
<div class="form-text" id="@($"{_helpScope}-2")">Scope requested from the token endpoint; leave blank for the Microsoft 365 default.</div>
|
||||
</div>
|
||||
}
|
||||
@if (_formError != null)
|
||||
@@ -368,3 +368,7 @@
|
||||
private static string? NormalizeOptional(string? value)
|
||||
=> string.IsNullOrWhiteSpace(value) ? null : value.Trim();
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@code { private readonly string _helpScope = "help-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
+14
-12
@@ -40,8 +40,8 @@
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Site</label>
|
||||
<select class="form-select form-select-sm" @bind="_formSiteIdentifier" data-test="secured-write-site">
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-1")">Site</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" @bind="_formSiteIdentifier" data-test="secured-write-site">
|
||||
<option value="">— select site —</option>
|
||||
@foreach (var site in _sites)
|
||||
{
|
||||
@@ -50,8 +50,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">MxGateway connection</label>
|
||||
<select class="form-select form-select-sm" @bind="_formConnectionName" data-test="secured-write-connection"
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-2")">MxGateway connection</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" @bind="_formConnectionName" data-test="secured-write-connection"
|
||||
disabled="@(MxConnectionsForForm.Count == 0)">
|
||||
<option value="">@(MxConnectionsForForm.Count == 0 ? "— no MxGateway connections —" : "— select connection —")</option>
|
||||
@foreach (var conn in MxConnectionsForForm)
|
||||
@@ -61,9 +61,9 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Tag path</label>
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-3")">Tag path</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control form-control-sm" @bind="_formTagPath"
|
||||
<input id="@($"{_fieldScope}-field-3")" class="form-control form-control-sm" @bind="_formTagPath"
|
||||
placeholder="e.g. PLC1.Pump.Setpoint" data-test="secured-write-tagpath" />
|
||||
<button class="btn btn-outline-secondary" type="button"
|
||||
disabled="@(!CanBrowse)"
|
||||
@@ -72,12 +72,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Value</label>
|
||||
<input class="form-control form-control-sm" @bind="_formValue" data-test="secured-write-value" />
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-4")">Value</label>
|
||||
<input id="@($"{_fieldScope}-field-4")" class="form-control form-control-sm" @bind="_formValue" data-test="secured-write-value" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Data type</label>
|
||||
<select class="form-select form-select-sm" @bind="_formValueType" data-test="secured-write-datatype">
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-5")">Data type</label>
|
||||
<select id="@($"{_fieldScope}-field-5")" class="form-select form-select-sm" @bind="_formValueType" data-test="secured-write-datatype">
|
||||
@foreach (var dt in Enum.GetNames<DataType>())
|
||||
{
|
||||
<option value="@dt">@dt</option>
|
||||
@@ -85,8 +85,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label form-label-sm">Comment <span class="text-muted">(optional)</span></label>
|
||||
<input class="form-control form-control-sm" @bind="_formComment" data-test="secured-write-comment" />
|
||||
<label class="form-label form-label-sm" for="@($"{_fieldScope}-field-6")">Comment <span class="text-muted">(optional)</span></label>
|
||||
<input id="@($"{_fieldScope}-field-6")" class="form-control form-control-sm" @bind="_formComment" data-test="secured-write-comment" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
@@ -506,3 +506,5 @@
|
||||
_ => "text-bg-light"
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</label>
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
<select id="alarm-attr-select"
|
||||
<select aria-describedby="@((_selectedChoice != null && !IsAttributeCompatible(_selectedChoice)) || (!string.IsNullOrEmpty(_model.AttributeName) && _selectedChoice == null) ? $"{_fieldScope}-attribute-hint" : null)" id="alarm-attr-select"
|
||||
class="form-select"
|
||||
@bind="_attributeName"
|
||||
@bind:after="OnAttributeChanged">
|
||||
@@ -60,13 +60,13 @@
|
||||
|
||||
@if (_selectedChoice != null && !IsAttributeCompatible(_selectedChoice))
|
||||
{
|
||||
<div class="form-text text-danger">
|
||||
<div id="@($"{_fieldScope}-attribute-hint")" class="form-text text-danger">
|
||||
Selected attribute is @_selectedChoice.DataType — this trigger type requires a numeric attribute.
|
||||
</div>
|
||||
}
|
||||
else if (_selectedChoice == null && !string.IsNullOrWhiteSpace(_model.AttributeName))
|
||||
{
|
||||
<div class="form-text text-warning-emphasis">
|
||||
<div id="@($"{_fieldScope}-attribute-hint")" class="form-text text-warning-emphasis">
|
||||
"@_model.AttributeName" is not in the current template. Save will still write it as-is.
|
||||
</div>
|
||||
}
|
||||
@@ -201,10 +201,10 @@
|
||||
{
|
||||
<div class="row g-2">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-1")">
|
||||
Operator
|
||||
</label>
|
||||
<select class="form-select form-select-sm"
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm"
|
||||
@bind="_operatorText"
|
||||
@bind:after="OnOperatorChanged">
|
||||
<option value="eq">equals</option>
|
||||
@@ -212,14 +212,14 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-2")">
|
||||
Match value
|
||||
</label>
|
||||
@{
|
||||
var t = _selectedChoice?.DataType;
|
||||
if (t == "Boolean")
|
||||
{
|
||||
<select class="form-select form-select-sm"
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm"
|
||||
data-test="alarm-matchvalue-input"
|
||||
@bind="_matchValueText"
|
||||
@bind:after="OnMatchValueChanged">
|
||||
@@ -229,7 +229,7 @@
|
||||
}
|
||||
else if (IsNumericType(t ?? ""))
|
||||
{
|
||||
<input type="number" step="any" class="form-control form-control-sm"
|
||||
<input id="@($"{_fieldScope}-field-2")" type="number" step="any" class="form-control form-control-sm"
|
||||
data-test="alarm-matchvalue-input"
|
||||
@bind="_matchValueText"
|
||||
@bind:event="oninput"
|
||||
@@ -237,7 +237,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control form-control-sm"
|
||||
data-test="alarm-matchvalue-input"
|
||||
placeholder="value"
|
||||
@bind="_matchValueText"
|
||||
@@ -255,20 +255,20 @@
|
||||
{
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-3")">
|
||||
Minimum
|
||||
</label>
|
||||
<input type="number" step="any" class="form-control form-control-sm"
|
||||
<input id="@($"{_fieldScope}-field-3")" type="number" step="any" class="form-control form-control-sm"
|
||||
@bind="_minText"
|
||||
@bind:event="oninput"
|
||||
@bind:after="OnMinChanged" />
|
||||
</div>
|
||||
<div class="col-md-2 text-center pb-1 text-muted small">to</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-4")">
|
||||
Maximum
|
||||
</label>
|
||||
<input type="number" step="any" class="form-control form-control-sm"
|
||||
<input id="@($"{_fieldScope}-field-4")" type="number" step="any" class="form-control form-control-sm"
|
||||
@bind="_maxText"
|
||||
@bind:event="oninput"
|
||||
@bind:after="OnMaxChanged" />
|
||||
@@ -311,11 +311,11 @@
|
||||
{
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-5")">
|
||||
Rate threshold
|
||||
</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="number" step="any" class="form-control"
|
||||
<input id="@($"{_fieldScope}-field-5")" type="number" step="any" class="form-control"
|
||||
@bind="_thresholdText"
|
||||
@bind:event="oninput"
|
||||
@bind:after="OnThresholdChanged" />
|
||||
@@ -323,11 +323,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-6")">
|
||||
Sampling window
|
||||
</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="number" step="any" min="0" class="form-control"
|
||||
<input id="@($"{_fieldScope}-field-6")" type="number" step="any" min="0" class="form-control"
|
||||
@bind="_windowText"
|
||||
@bind:event="oninput"
|
||||
@bind:after="OnWindowChanged" />
|
||||
@@ -338,10 +338,10 @@
|
||||
|
||||
<div class="mt-3 row g-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-7")">
|
||||
Direction
|
||||
</label>
|
||||
<select class="form-select form-select-sm"
|
||||
<select id="@($"{_fieldScope}-field-7")" class="form-select form-select-sm"
|
||||
@bind="_directionText"
|
||||
@bind:after="OnDirectionChanged">
|
||||
<option value="rising">Rising only</option>
|
||||
@@ -428,12 +428,12 @@
|
||||
{
|
||||
<div class="row g-2 align-items-end mb-1">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small text-uppercase fw-semibold mb-1 @severityClass">
|
||||
<label class="form-label small text-uppercase fw-semibold mb-1 @severityClass" for="@($"{_fieldScope}-{setpointTestId}-0")">
|
||||
@label
|
||||
</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text">setpoint</span>
|
||||
<input type="number" step="any" class="form-control"
|
||||
<input id="@($"{_fieldScope}-{setpointTestId}-0")" type="number" step="any" class="form-control"
|
||||
data-test="@setpointTestId"
|
||||
placeholder="—"
|
||||
value="@value"
|
||||
@@ -441,23 +441,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-{setpointTestId}-1")">
|
||||
Deadband
|
||||
</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text">±</span>
|
||||
<input type="number" step="any" min="0" class="form-control"
|
||||
<input id="@($"{_fieldScope}-{setpointTestId}-1")" type="number" step="any" min="0" class="form-control"
|
||||
placeholder="0"
|
||||
value="@deadband"
|
||||
@oninput="@(e => { deadbandSetter(e.Value?.ToString()); _ = onDeadbandChanged(); })" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-{setpointTestId}-2")">
|
||||
Priority
|
||||
</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="number" min="0" max="1000" class="form-control"
|
||||
<input id="@($"{_fieldScope}-{setpointTestId}-2")" type="number" min="0" max="1000" class="form-control"
|
||||
placeholder="@_priority"
|
||||
value="@priority"
|
||||
@oninput="@(e => { prioritySetter(e.Value?.ToString()); _ = onPriorityChanged(); })" />
|
||||
@@ -466,7 +466,7 @@
|
||||
</div>
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="@($"Operator message for {label}")" type="text" class="form-control form-control-sm"
|
||||
placeholder="Optional operator message for this band…"
|
||||
value="@message"
|
||||
@oninput="@(e => { messageSetter(e.Value?.ToString()); _ = onMessageChanged(); })" />
|
||||
@@ -580,8 +580,9 @@
|
||||
|
||||
private RenderFragment RenderExpression() => __builder =>
|
||||
{
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">Trigger expression</label>
|
||||
<MonacoEditor Height="120px"
|
||||
<div role="group" aria-label="Trigger expression" aria-describedby="@($"{_fieldScope}-expression-hint")">
|
||||
<div class="form-label small text-uppercase text-muted fw-semibold mb-1">Trigger expression</div>
|
||||
<MonacoEditor AriaLabel="Alarm trigger expression" Height="120px"
|
||||
Language="csharp"
|
||||
ScriptKind="ScriptAnalysis.ScriptKind.Template"
|
||||
ShowToolbar="false"
|
||||
@@ -589,9 +590,10 @@
|
||||
ValueChanged="OnExpressionChanged"
|
||||
SelfAttributes="@TriggerAttributeMapper.SelfAttributes(AvailableAttributes)"
|
||||
Children="@TriggerAttributeMapper.Children(AvailableAttributes)" />
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-expression-hint")">
|
||||
A boolean C# expression — e.g. <code>Attributes["Temperature"] > 80</code>.
|
||||
</div>
|
||||
</div>
|
||||
@* Analysis-kind selector — Advisory (default) keeps the blank-expression
|
||||
finding as a non-blocking warning; Strict escalates it to a deploy-blocking error. *@
|
||||
<div class="mt-2">
|
||||
@@ -677,3 +679,5 @@
|
||||
double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var v) ? v : null;
|
||||
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
@if (ShowElementType)
|
||||
{
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Element Type</label>
|
||||
<select class="form-select" value="@ElementDataType" @onchange="OnElementTypeChanged" disabled="@Disabled">
|
||||
<label class="form-label" for="@($"{_fieldScope}-field-1")">Element Type</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select" value="@ElementDataType" @onchange="OnElementTypeChanged" disabled="@Disabled">
|
||||
@foreach (var dt in ElementTypes)
|
||||
{
|
||||
<option value="@dt">@dt</option>
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<label class="form-label">List Values</label>
|
||||
<div class="form-label">List Values</div>
|
||||
@if (Rows.Count == 0)
|
||||
{
|
||||
<p class="text-muted small mb-2">No elements. Use “Add element” to add one.</p>
|
||||
@@ -44,7 +44,7 @@
|
||||
var index = i;
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" style="min-width: 2.5rem;">@index</span>
|
||||
<input type="text" class="form-control font-monospace"
|
||||
<input aria-label="List element value" type="text" class="form-control font-monospace"
|
||||
value="@Rows[index]"
|
||||
placeholder="@Placeholder()"
|
||||
@oninput="e => OnRowInput(index, (string?)e.Value)"
|
||||
@@ -128,3 +128,5 @@
|
||||
_ => "text value"
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
Server-side compose failures are surfaced by the parent via a toast.
|
||||
*@
|
||||
<div class="mb-3">
|
||||
<label class="form-label small text-muted mb-1">Parent template</label>
|
||||
<select class="form-select form-select-sm" @bind="_parentTemplateId">
|
||||
<label class="form-label small text-muted mb-1" for="@($"{_fieldScope}-field-1")">Parent template</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" @bind="_parentTemplateId">
|
||||
<option value="0" disabled selected>Select a parent template…</option>
|
||||
@foreach (var opt in ParentOptions)
|
||||
{
|
||||
@@ -18,8 +18,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<label class="form-label small text-muted mb-1">Slot name</label>
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<label class="form-label small text-muted mb-1" for="@($"{_fieldScope}-field-2")">Slot name</label>
|
||||
<input id="@($"{_fieldScope}-field-2")" type="text" class="form-control form-control-sm"
|
||||
placeholder="Slot name"
|
||||
@bind="_slotName" @bind:event="oninput" />
|
||||
</div>
|
||||
@@ -57,3 +57,5 @@
|
||||
/// <param name="SlotName">The trimmed slot (composition instance) name.</param>
|
||||
public sealed record ComposeResult(int ParentTemplateId, string SlotName);
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
{
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-4">
|
||||
<label for="@_searchId" class="form-label small">Search</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Search..."
|
||||
<input id="@_searchId" type="text" class="form-control form-control-sm" placeholder="Search..."
|
||||
@bind="_searchTerm" @bind:event="oninput" @bind:after="ApplyFilter" />
|
||||
@if (!string.IsNullOrEmpty(_searchTerm))
|
||||
{
|
||||
@@ -90,6 +91,7 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private readonly string _searchId = "table-search-" + Guid.NewGuid().ToString("N");
|
||||
private string _searchTerm = string.Empty;
|
||||
private int _currentPage = 1;
|
||||
private List<TItem> _filteredItems = new();
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
Unchanged instances are skipped unless Force is checked.
|
||||
</p>
|
||||
<div class="form-check mb-1">
|
||||
<input type="checkbox" class="form-check-input" id="deploy-all-force" data-test="deploy-all-force"
|
||||
<input type="checkbox" class="form-check-input" id="deploy-all-force" aria-describedby="deploy-all-force-hint" data-test="deploy-all-force"
|
||||
@bind="_force" />
|
||||
<label class="form-check-label small" for="deploy-all-force">Force redeploy up-to-date instances</label>
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<div id="deploy-all-force-hint" class="form-text">
|
||||
A redeploy resets an instance's static attribute overrides and clears its native alarm state.
|
||||
Disabled instances are never deployed or re-enabled.
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
style="height: @Height; border: 1px solid var(--bs-border-color); border-radius: 0.25rem; overflow: hidden;"></div>
|
||||
|
||||
@code {
|
||||
/// <summary>Accessible name passed to the actual Monaco input.</summary>
|
||||
[Parameter] public string AriaLabel { get; set; } = "Code editor";
|
||||
[Parameter] public string Value { get; set; } = "";
|
||||
[Parameter] public EventCallback<string> ValueChanged { get; set; }
|
||||
[Parameter] public string Language { get; set; } = "csharp";
|
||||
@@ -103,6 +105,7 @@
|
||||
private string _lastSentValue = "";
|
||||
private string? _lastSentSchema;
|
||||
private bool _initialized;
|
||||
private string? _lastAriaLabel;
|
||||
private bool _wrap;
|
||||
private bool _minimap;
|
||||
private bool _dark;
|
||||
@@ -124,10 +127,12 @@
|
||||
value = Value ?? "",
|
||||
language = Language,
|
||||
readOnly = ReadOnly,
|
||||
jsonSchema = JsonSchema
|
||||
jsonSchema = JsonSchema,
|
||||
ariaLabel = AriaLabel
|
||||
},
|
||||
_dotNetRef);
|
||||
_initialized = true;
|
||||
_lastAriaLabel = AriaLabel;
|
||||
_lastSentSchema = JsonSchema;
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
@@ -147,6 +152,11 @@
|
||||
}
|
||||
else if (_initialized)
|
||||
{
|
||||
if (_lastAriaLabel != AriaLabel)
|
||||
{
|
||||
_lastAriaLabel = AriaLabel;
|
||||
await SafeInvokeAsync("MonacoBlazor.setEditorOption", "set editor accessibility name", _id, "ariaLabel", AriaLabel);
|
||||
}
|
||||
if ((Value ?? "") != _lastSentValue)
|
||||
{
|
||||
_lastSentValue = Value ?? "";
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*@
|
||||
@if (SiteOptions.Any())
|
||||
{
|
||||
<select class="form-select form-select-sm" @bind="_targetSiteId">
|
||||
<select aria-label="Target site" class="form-select form-select-sm" @bind="_targetSiteId">
|
||||
@foreach (var opt in SiteOptions)
|
||||
{
|
||||
<option value="@opt.Id">@opt.Label</option>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
indistinguishable from a Cancel). The parent validates after the dialog closes
|
||||
and toasts any server guard failure.
|
||||
*@
|
||||
<select class="form-select form-select-sm" @bind="_targetParentId">
|
||||
<select aria-label="Parent folder" class="form-select form-select-sm" @bind="_targetParentId">
|
||||
@foreach (var opt in FolderOptions)
|
||||
{
|
||||
<option value="@opt.Id">@opt.Label</option>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
with a MoveTemplateResult carrying the picked folder id (null = Root) — a result
|
||||
record so Close(null) for the Root choice stays distinguishable from a Cancel.
|
||||
*@
|
||||
<select class="form-select form-select-sm" @bind="_targetFolderId">
|
||||
<select aria-label="Target template folder" class="form-select form-select-sm" @bind="_targetFolderId">
|
||||
@foreach (var opt in FolderOptions)
|
||||
{
|
||||
<option value="@opt.Id">@opt.Label</option>
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
block of chip buttons with a single control of one row's height.
|
||||
*@
|
||||
<div class="dropdown msd" data-test="@DataTest">
|
||||
<button type="button"
|
||||
<button type="button" aria-labelledby="@ToggleLabelledBy"
|
||||
class="btn btn-sm btn-outline-secondary dropdown-toggle msd-toggle text-start"
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
aria-expanded="false"
|
||||
disabled="@(Items.Count == 0)"
|
||||
data-test="@($"{DataTest}-toggle")">
|
||||
<span class="msd-summary">@Summary()</span>
|
||||
<span id="@_summaryId" class="msd-summary">@Summary()</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu msd-menu">
|
||||
@if (Items.Count == 0)
|
||||
|
||||
@@ -54,6 +54,11 @@ public partial class MultiSelectDropdown<TValue> where TValue : notnull
|
||||
[Parameter]
|
||||
public string DataTest { get; set; } = "multi-select";
|
||||
|
||||
/// <summary>ID of the visible field label; combined with the current selection summary.</summary>
|
||||
[Parameter] public string? LabelledBy { get; set; }
|
||||
private readonly string _summaryId = "selection-" + Guid.NewGuid().ToString("N");
|
||||
private string? ToggleLabelledBy => string.IsNullOrWhiteSpace(LabelledBy) ? null : LabelledBy + " " + _summaryId;
|
||||
|
||||
private async Task Toggle(TValue item)
|
||||
{
|
||||
// ICollection.Remove returns false when the item was absent — that is the
|
||||
|
||||
@@ -30,12 +30,22 @@ else
|
||||
var shape = _shapes.FirstOrDefault(s => s.Name == field.Name);
|
||||
<div class="row g-2 @(IsScalar(field.Schema) ? "align-items-center" : "align-items-start")">
|
||||
<div class="col-sm-4">
|
||||
<label class="form-label small mb-0" for="@FieldId(field.Name)">
|
||||
@if (IsScalar(field.Schema))
|
||||
{
|
||||
<label id="@(FieldId(field.Name) + "-label")" for="@FieldId(field.Name)" class="form-label small mb-0">
|
||||
<code>@field.Name</code>
|
||||
<span class="text-muted ms-1">@(shape?.Type ?? DisplayType(field.Schema))@(field.Required ? "" : "?")</span>
|
||||
</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div id="@(FieldId(field.Name) + "-label")" class="form-label small mb-0">
|
||||
<code>@field.Name</code>
|
||||
<span class="text-muted ms-1">@(shape?.Type ?? DisplayType(field.Schema))@(field.Required ? "" : "?")</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-8" role="group" aria-labelledby="@(FieldId(field.Name) + "-label")">
|
||||
@RenderNode(field.Schema, field.Name, FieldId(field.Name))
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,7 +250,9 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
private static string FieldId(string path) => $"param-{path}";
|
||||
private readonly string _parameterScope = "param-" + Guid.NewGuid().ToString("N") + "-";
|
||||
private string FieldId(string path) => _parameterScope + Convert.ToHexString(System.Text.Encoding.UTF8.GetBytes(path));
|
||||
private string? ErrorDescription(string path) => _parseErrors.ContainsKey(path) ? FieldId(path) + "-error" : null;
|
||||
|
||||
private static bool IsScalar(InboundApiSchema schema) =>
|
||||
schema.Type is "boolean" or "integer" or "number" or "string";
|
||||
@@ -264,28 +276,28 @@ else
|
||||
{
|
||||
case "boolean":
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="@id"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-check-input" type="checkbox" id="@id"
|
||||
checked="@AsBool(path)"
|
||||
@onchange="e => SetBool(path, (bool)(e.Value ?? false))" />
|
||||
</div>
|
||||
break;
|
||||
|
||||
case "integer":
|
||||
<input class="form-control form-control-sm" type="number" step="1" id="@id"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm" type="number" step="1" id="@id"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetNumeric(path, (string?)e.Value, integerOnly: true)" />
|
||||
@RenderError(path)
|
||||
break;
|
||||
|
||||
case "number":
|
||||
<input class="form-control form-control-sm" type="number" step="any" id="@id"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm" type="number" step="any" id="@id"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetNumeric(path, (string?)e.Value, integerOnly: false)" />
|
||||
@RenderError(path)
|
||||
break;
|
||||
|
||||
case "string":
|
||||
<input class="form-control form-control-sm" type="text" id="@id"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm" type="text" id="@id"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetString(path, (string?)e.Value)" />
|
||||
@RenderError(path)
|
||||
@@ -300,8 +312,9 @@ else
|
||||
break;
|
||||
|
||||
default: // unresolved $ref / unknown — raw-JSON escape hatch (Monaco).
|
||||
<div class="param-json-editor" data-path="@path">
|
||||
<MonacoEditor Language="json" Height="120px" ShowToolbar="false"
|
||||
<div class="param-json-editor" data-path="@path" role="group" aria-label="@($"Parameter {path} JSON")"
|
||||
aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)">
|
||||
<MonacoEditor AriaLabel="@($"Parameter {path} JSON")" Language="json" Height="120px" ShowToolbar="false"
|
||||
JsonSchema="@FieldSchemaJson(schema)"
|
||||
Value="@AsRaw(path)"
|
||||
ValueChanged="@(v => SetJson(path, v))" />
|
||||
@@ -319,12 +332,22 @@ else
|
||||
var childPath = JoinField(path, field.Name);
|
||||
<div class="row g-2 @(IsScalar(field.Schema) ? "align-items-center" : "align-items-start")">
|
||||
<div class="col-sm-4">
|
||||
<label class="form-label small mb-0" for="@FieldId(childPath)">
|
||||
@if (IsScalar(field.Schema))
|
||||
{
|
||||
<label id="@(FieldId(childPath) + "-label")" for="@FieldId(childPath)" class="form-label small mb-0">
|
||||
<code>@field.Name</code>
|
||||
<span class="text-muted ms-1">@DisplayType(field.Schema)@(field.Required ? "" : "?")</span>
|
||||
</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div id="@(FieldId(childPath) + "-label")" class="form-label small mb-0">
|
||||
<code>@field.Name</code>
|
||||
<span class="text-muted ms-1">@DisplayType(field.Schema)@(field.Required ? "" : "?")</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-8" role="group" aria-labelledby="@(FieldId(childPath) + "-label")">
|
||||
@RenderNode(field.Schema, childPath, FieldId(childPath))
|
||||
</div>
|
||||
</div>
|
||||
@@ -364,28 +387,28 @@ else
|
||||
{
|
||||
case "boolean":
|
||||
<div class="form-check">
|
||||
<input class="form-check-input param-list-item" type="checkbox" id="@FieldId(path)"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-check-input param-list-item" type="checkbox" id="@FieldId(path)"
|
||||
checked="@AsBool(path)"
|
||||
@onchange="e => SetBool(path, (bool)(e.Value ?? false))" />
|
||||
</div>
|
||||
break;
|
||||
|
||||
case "integer":
|
||||
<input class="form-control form-control-sm param-list-item" type="number" step="1" id="@FieldId(path)"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm param-list-item" type="number" step="1" id="@FieldId(path)"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetNumeric(path, (string?)e.Value, integerOnly: true)" />
|
||||
@RenderError(path)
|
||||
break;
|
||||
|
||||
case "number":
|
||||
<input class="form-control form-control-sm param-list-item" type="number" step="any" id="@FieldId(path)"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm param-list-item" type="number" step="any" id="@FieldId(path)"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetNumeric(path, (string?)e.Value, integerOnly: false)" />
|
||||
@RenderError(path)
|
||||
break;
|
||||
|
||||
case "string":
|
||||
<input class="form-control form-control-sm param-list-item" type="text" id="@FieldId(path)"
|
||||
<input data-param-path="@path" aria-label="@path" aria-invalid="@(_parseErrors.ContainsKey(path) ? "true" : "false")" aria-describedby="@ErrorDescription(path)" class="form-control form-control-sm param-list-item" type="text" id="@FieldId(path)"
|
||||
value="@AsRaw(path)"
|
||||
@oninput="e => SetString(path, (string?)e.Value)" />
|
||||
@RenderError(path)
|
||||
@@ -401,7 +424,7 @@ else
|
||||
{
|
||||
if (_parseErrors.TryGetValue(path, out var err))
|
||||
{
|
||||
<div class="text-danger small mt-1">@err</div>
|
||||
<div id="@(FieldId(path) + "-error")" role="alert" class="text-danger small mt-1">@err</div>
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
while the field is blank (client-side guard); server-side rename failures are
|
||||
surfaced by the parent via a toast.
|
||||
*@
|
||||
<input class="form-control form-control-sm" @bind="_name" @bind:event="oninput" />
|
||||
<input aria-label="Folder name" class="form-control form-control-sm" @bind="_name" @bind:event="oninput" />
|
||||
|
||||
<div class="modal-footer px-0 pb-0 mt-3">
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
|
||||
@@ -104,11 +104,11 @@ else
|
||||
private RenderFragment PropertyRow(SchemaNode parent, SchemaProperty prop) => __builder =>
|
||||
{
|
||||
<div class="d-flex flex-wrap align-items-center gap-2">
|
||||
<input type="text" class="form-control form-control-sm"
|
||||
<input aria-label="@($"Property name: {prop.Name}")" type="text" class="form-control form-control-sm"
|
||||
style="max-width: 14rem;" placeholder="name"
|
||||
@bind="prop.Name" @bind:event="oninput" @bind:after="Emit" />
|
||||
|
||||
<select class="form-select form-select-sm" style="max-width: 9rem;"
|
||||
<select aria-label="@($"Type for {prop.Name}")" class="form-select form-select-sm" style="max-width: 9rem;"
|
||||
@bind="prop.Schema.Type" @bind:after="() => OnTypeChange(prop.Schema)">
|
||||
@foreach (var t in SchemaBuilderModel.PrimitiveTypes)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ else
|
||||
@if (prop.Schema.Type == "array")
|
||||
{
|
||||
<span class="small text-muted">items:</span>
|
||||
<select class="form-select form-select-sm" style="max-width: 9rem;"
|
||||
<select aria-label="@($"Array item type for {prop.Name}")" class="form-select form-select-sm" style="max-width: 9rem;"
|
||||
@bind="prop.Schema.Items!.Type" @bind:after="() => OnTypeChange(prop.Schema.Items!)">
|
||||
@foreach (var t in SchemaBuilderModel.PrimitiveTypes)
|
||||
{
|
||||
@@ -171,8 +171,8 @@ else
|
||||
private RenderFragment ValueRoot(SchemaNode node) => __builder =>
|
||||
{
|
||||
<div class="d-flex flex-wrap align-items-center gap-2 mb-2">
|
||||
<label class="form-label mb-0">Return type:</label>
|
||||
<select class="form-select form-select-sm" style="max-width: 10rem;"
|
||||
<label class="form-label mb-0" for="@($"{_fieldScope}-field-1")">Return type:</label>
|
||||
<select id="@($"{_fieldScope}-field-1")" class="form-select form-select-sm" style="max-width: 10rem;"
|
||||
@bind="node.Type" @bind:after="() => OnTypeChange(node)">
|
||||
@foreach (var t in SchemaBuilderModel.PrimitiveTypes)
|
||||
{
|
||||
@@ -182,8 +182,8 @@ else
|
||||
|
||||
@if (node.Type == "array")
|
||||
{
|
||||
<label class="form-label mb-0 ms-2">Item type:</label>
|
||||
<select class="form-select form-select-sm" style="max-width: 10rem;"
|
||||
<label class="form-label mb-0 ms-2" for="@($"{_fieldScope}-field-2")">Item type:</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm" style="max-width: 10rem;"
|
||||
@bind="node.Items!.Type" @bind:after="() => OnTypeChange(node.Items!)">
|
||||
@foreach (var t in SchemaBuilderModel.PrimitiveTypes)
|
||||
{
|
||||
@@ -205,3 +205,5 @@ else
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -193,13 +193,13 @@
|
||||
{
|
||||
<div class="row g-2 align-items-end" style="max-width: 420px;">
|
||||
<div class="col-7">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">Run every</label>
|
||||
<input type="number" min="1" step="1" class="form-control form-control-sm"
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-1")">Run every</label>
|
||||
<input id="@($"{_fieldScope}-field-1")" type="number" min="1" step="1" class="form-control form-control-sm"
|
||||
placeholder="period"
|
||||
@bind="_intervalText" @bind:event="oninput" @bind:after="OnIntervalChanged" />
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<select class="form-select form-select-sm"
|
||||
<select aria-label="Run interval unit" class="form-select form-select-sm"
|
||||
@bind="_intervalUnit" @bind:after="OnIntervalChanged">
|
||||
<option value="ms">milliseconds</option>
|
||||
<option value="sec">seconds</option>
|
||||
@@ -225,8 +225,8 @@
|
||||
<div class="mb-2">@RenderAttributePicker("Monitored attribute")</div>
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">Operator</label>
|
||||
<select class="form-select form-select-sm"
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-2")">Operator</label>
|
||||
<select id="@($"{_fieldScope}-field-2")" class="form-select form-select-sm"
|
||||
@bind="_operator" @bind:after="OnOperatorChanged">
|
||||
@foreach (var op in ScriptTriggerConfigCodec.Operators)
|
||||
{
|
||||
@@ -235,8 +235,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">Threshold</label>
|
||||
<input type="number" step="any" class="form-control form-control-sm"
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-3")">Threshold</label>
|
||||
<input id="@($"{_fieldScope}-field-3")" type="number" step="any" class="form-control form-control-sm"
|
||||
placeholder="numeric value"
|
||||
@bind="_thresholdText" @bind:event="oninput" @bind:after="OnThresholdChanged" />
|
||||
</div>
|
||||
@@ -262,8 +262,9 @@
|
||||
|
||||
private RenderFragment RenderExpression() => __builder =>
|
||||
{
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">Trigger expression</label>
|
||||
<MonacoEditor Height="120px"
|
||||
<div role="group" aria-label="Trigger expression" aria-describedby="@($"{_fieldScope}-expression-hint")">
|
||||
<div class="form-label small text-uppercase text-muted fw-semibold mb-1">Trigger expression</div>
|
||||
<MonacoEditor AriaLabel="Script trigger expression" Height="120px"
|
||||
Language="csharp"
|
||||
ScriptKind="ScriptAnalysis.ScriptKind.Template"
|
||||
ShowToolbar="false"
|
||||
@@ -271,9 +272,10 @@
|
||||
ValueChanged="OnExpressionChanged"
|
||||
SelfAttributes="@TriggerAttributeMapper.SelfAttributes(AvailableAttributes)"
|
||||
Children="@TriggerAttributeMapper.Children(AvailableAttributes)" />
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-expression-hint")">
|
||||
A boolean C# expression — e.g. <code>Attributes["Temperature"] > 80</code>.
|
||||
</div>
|
||||
</div>
|
||||
@* Analysis-kind selector — Advisory keeps the blank-expression finding
|
||||
as a non-blocking warning; Strict escalates it to a deploy-blocking error. *@
|
||||
<div class="mt-2">
|
||||
@@ -314,7 +316,7 @@
|
||||
<label for="script-trigger-mode" class="form-label small text-uppercase text-muted fw-semibold mb-1">
|
||||
Fire mode
|
||||
</label>
|
||||
<select id="script-trigger-mode" class="form-select form-select-sm"
|
||||
<select aria-describedby="@(_model.Mode == ScriptTriggerMode.WhileTrue ? $"{_fieldScope}-mode-hint" : null)" id="script-trigger-mode" class="form-select form-select-sm"
|
||||
style="max-width: 420px;"
|
||||
@bind="_model.Mode" @bind:after="OnModeChanged">
|
||||
<option value="@ScriptTriggerMode.OnTrue">
|
||||
@@ -326,7 +328,7 @@
|
||||
</select>
|
||||
@if (_model.Mode == ScriptTriggerMode.WhileTrue)
|
||||
{
|
||||
<div class="form-text">
|
||||
<div class="form-text" id="@($"{_fieldScope}-mode-hint")">
|
||||
Re-runs on a timer while the condition holds, at the script's
|
||||
<strong>Min time between runs</strong> interval — set that field below
|
||||
the script editor, or the trigger fires only once.
|
||||
@@ -341,8 +343,8 @@
|
||||
|
||||
private RenderFragment RenderAttributePicker(string label) => __builder =>
|
||||
{
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1">@label</label>
|
||||
<select class="form-select form-select-sm"
|
||||
<label class="form-label small text-uppercase text-muted fw-semibold mb-1" for="@($"{_fieldScope}-field-4")">@label</label>
|
||||
<select id="@($"{_fieldScope}-field-4")" class="form-select form-select-sm"
|
||||
@bind="_attributeName" @bind:after="OnAttributeChanged">
|
||||
<option value="">— select attribute —</option>
|
||||
@{
|
||||
@@ -437,3 +439,5 @@
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
|
||||
@code { private readonly string _fieldScope = "field-" + Guid.NewGuid().ToString("N"); }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<div class="d-flex gap-2 align-items-center mb-2">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" data-test="picker-search" placeholder="Search templates..."
|
||||
<input aria-label="Search templates" type="text" class="form-control" data-test="picker-search" placeholder="Search templates..."
|
||||
value="@_search" @oninput="OnSearchInput" />
|
||||
@if (!string.IsNullOrEmpty(_search))
|
||||
{
|
||||
|
||||
@@ -50,6 +50,7 @@ else
|
||||
{
|
||||
var key = KeySelector(item);
|
||||
var keyStr = KeyStr(key);
|
||||
var contentId = _contentScope + Convert.ToHexString(System.Text.Encoding.UTF8.GetBytes(keyStr));
|
||||
var children = ChildrenSelector(item);
|
||||
var isBranch = HasChildrenSelector(item);
|
||||
var isExpanded = _expandedKeys.Contains(keyStr);
|
||||
@@ -111,7 +112,7 @@ else
|
||||
a consumer's buttons/inputs inside NodeContent keep their own key handling. *@
|
||||
@if (SelectionMode == TreeViewSelectionMode.Checkbox)
|
||||
{
|
||||
<input type="checkbox"
|
||||
<input aria-labelledby="@contentId" type="checkbox"
|
||||
class="form-check-input tv-checkbox @(checkState == CheckState.Indeterminate ? "tv-checkbox-indeterminate" : "")"
|
||||
@ref="_checkboxRefs[keyStr]"
|
||||
checked="@(checkState == CheckState.Checked)"
|
||||
@@ -119,7 +120,7 @@ else
|
||||
@onclick:stopPropagation
|
||||
@onkeydown:stopPropagation />
|
||||
}
|
||||
<span class="tv-content" @onclick="() => OnContentClick(key)" @onclick:stopPropagation @onkeydown:stopPropagation>
|
||||
<span id="@contentId" class="tv-content" @onclick="() => OnContentClick(key)" @onclick:stopPropagation @onkeydown:stopPropagation>
|
||||
@NodeContent(item)
|
||||
</span>
|
||||
</div>
|
||||
@@ -137,6 +138,7 @@ else
|
||||
}
|
||||
|
||||
@code {
|
||||
private readonly string _contentScope = "tree-content-" + Guid.NewGuid().ToString("N") + "-";
|
||||
private IReadOnlyList<TItem>? _items;
|
||||
private HashSet<string> _expandedKeys = new();
|
||||
|
||||
|
||||
@@ -343,6 +343,7 @@
|
||||
}
|
||||
|
||||
const editor = monaco.editor.create(host, {
|
||||
ariaLabel: options.ariaLabel || "Code editor",
|
||||
value: model ? undefined : (options.value || ""),
|
||||
model: model || undefined,
|
||||
language: model ? undefined : language,
|
||||
|
||||
Reference in New Issue
Block a user