Associate ScadaBridge controls, guidance and editor errors
This commit is contained in:
+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"); }
|
||||
|
||||
Reference in New Issue
Block a user