Standardize first runtime page and table anatomy

This commit is contained in:
Joseph Doherty
2026-11-13 21:24:07 -05:00
parent 169149f1eb
commit ee8ac73e8c
26 changed files with 755 additions and 50 deletions
@@ -18,11 +18,11 @@
@rendermode InteractiveServer
<PageErrorBoundary>
<PageTitle>Deployments</PageTitle>
<PageTitle>Deployments · OtOpcUa</PageTitle>
<h1>Deployments</h1>
<div class="page-head"><h1>Deployments</h1></div>
<div class="d-flex align-items-center gap-3 mb-3">
<div class="d-flex flex-wrap align-items-center gap-3 mb-3">
<button class="btn btn-primary" @onclick="StartDeploymentAsync" disabled="@_busy">
@(_busy ? "Deploying…" : "Deploy current configuration")
</button>
@@ -53,22 +53,23 @@
</div>
}
<table class="table table-striped table-sm">
<div class="table-wrap" role="region" aria-label="Deployment history" tabindex="0">
<table class="data-table">
<thead>
<tr>
<th>Deployment</th>
<th>Revision</th>
<th>Status</th>
<th>Created by</th>
<th>Created (UTC)</th>
<th>Sealed (UTC)</th>
<th scope="col">Deployment</th>
<th scope="col">Revision</th>
<th scope="col">Status</th>
<th scope="col">Created by</th>
<th scope="col">Created (UTC)</th>
<th scope="col">Sealed (UTC)</th>
</tr>
</thead>
<tbody>
@foreach (var d in _deployments)
{
<tr>
<td><code>@Short(d.DeploymentId)</code></td>
<th scope="row"><code>@Short(d.DeploymentId)</code></th>
<td><code>@DisplayText.Abbreviate(d.RevisionHash, 12)</code></td>
@* #601: Sealed + a reason = sealed with a degraded address-space apply on some node(s). *@
<td title="@(d.FailureReason ?? "")">@(d.Status == DeploymentStatus.Sealed && !string.IsNullOrEmpty(d.FailureReason) ? "Sealed (degraded)" : d.Status.ToString())</td>
@@ -79,6 +80,7 @@
}
</tbody>
</table>
</div>
</PageErrorBoundary>
@code {
@@ -17,11 +17,12 @@
@implements IAsyncDisposable
<PageErrorBoundary>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="mb-0">Fleet status</h4>
<PageTitle>Fleet status · OtOpcUa</PageTitle>
<div class="page-head">
<h1>Fleet status</h1>
</div>
<div class="d-flex align-items-center mb-3 gap-2">
<div class="d-flex flex-wrap align-items-center mb-3 gap-2">
<button class="btn btn-sm btn-outline-primary" @onclick="RefreshAsync" disabled="@_refreshing">
@if (_refreshing) { <span class="spinner-border spinner-border-sm me-1" /> }
Refresh
@@ -65,24 +66,24 @@ else
</section>
<section class="panel rise" style="animation-delay:.08s">
<div class="panel-head">Nodes</div>
<div class="table-wrap">
<h2 class="panel-head">Nodes</h2>
<div class="table-wrap" role="region" aria-label="Fleet nodes" tabindex="0">
<table class="data-table">
<thead>
<tr>
<th>Node</th>
<th>Roles</th>
<th>Status</th>
<th>Applied at</th>
<th>Started at</th>
<th>Failure reason</th>
<th scope="col">Node</th>
<th scope="col">Roles</th>
<th scope="col">Status</th>
<th scope="col">Applied at</th>
<th scope="col">Started at</th>
<th scope="col">Failure reason</th>
</tr>
</thead>
<tbody>
@foreach (var r in _rows)
{
<tr>
<td>
<th scope="row">
<span class="mono">@r.NodeId</span>
@* A-F4: the per-node diagnostics page was reachable only by URL. Driver nodes
answer it (the snapshot comes from their DriverHostActor). *@
@@ -90,7 +91,7 @@ else
{
<a class="small ms-2" href="@FleetDiagnosticsLinks.For(r.NodeId)">diagnostics</a>
}
</td>
</th>
<td>
@foreach (var role in r.Roles)
{
@@ -7,8 +7,10 @@
@inject IDbContextFactory<OtOpcUaConfigDbContext> DbFactory
<PageErrorBoundary>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="mb-0">Scripts</h4>
<PageTitle>Scripts · OtOpcUa</PageTitle>
<div class="page-head">
<h1>Scripts</h1>
<span class="spacer"></span>
<a href="/scripts/new" class="btn btn-primary btn-sm">New script</a>
</div>
@@ -19,25 +21,26 @@
else
{
<section class="panel rise mt-3" style="animation-delay:.08s">
<div class="panel-head">@_rows.Count script@(_rows.Count == 1 ? "" : "s")</div>
<h2 class="panel-head">@_rows.Count script@(_rows.Count == 1 ? "" : "s")</h2>
@if (_rows.Count == 0)
{
<div style="padding:1rem" class="text-muted">No scripts defined.</div>
}
else
{
<table class="table table-sm mb-0 align-middle">
<div class="table-wrap" role="region" aria-label="Scripts" tabindex="0">
<table class="data-table">
<thead>
<tr>
<th>Script</th>
<th></th>
<th scope="col">Script</th>
<th scope="col"><span class="visually-hidden">Actions</span></th>
</tr>
</thead>
<tbody>
@foreach (var s in _rows)
{
<tr>
<td>
<th scope="row">
<div>
<span>@(string.IsNullOrWhiteSpace(s.Name) ? s.ScriptId : s.Name)</span>
<span class="chip chip-idle ms-1">@s.Language</span>
@@ -45,7 +48,7 @@ else
<div class="mono small text-muted">
@s.ScriptId · hash=@DisplayText.Abbreviate(s.SourceHash, 12)
</div>
</td>
</th>
<td class="text-end">
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-sm btn-outline-secondary"
@@ -57,6 +60,7 @@ else
}
</tbody>
</table>
</div>
}
</section>
}
@@ -16,10 +16,11 @@
@inject NavigationManager Nav
<PageErrorBoundary>
<PageTitle>Equipment</PageTitle>
<PageTitle>Equipment · OtOpcUa</PageTitle>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="mb-0">@(IsNew ? "New equipment" : (_equipment?.Name ?? EquipmentId))</h4>
<div class="page-head">
<h1>@(IsNew ? "New equipment" : (_equipment?.Name ?? EquipmentId))</h1>
<span class="spacer"></span>
<a href="/uns" class="btn btn-outline-secondary btn-sm">Back to UNS</a>
</div>
@@ -46,7 +47,7 @@ else
<DataAnnotationsValidator />
<section class="panel rise" style="animation-delay:.02s">
<div class="panel-head">Identity</div>
<h2 class="panel-head">Identity</h2>
<div style="padding:1rem">
@if (!IsNew)
{
@@ -108,7 +109,7 @@ else
</section>
<section class="panel rise mt-3" style="animation-delay:.08s">
<div class="panel-head">OPC 40010 identification (optional)</div>
<h2 class="panel-head">OPC 40010 identification (optional)</h2>
<div style="padding:1rem">
<div class="row">
<div class="col-md-4 mb-3"><label class="form-label">Manufacturer</label><InputText @bind-Value="_form.Manufacturer" class="form-control form-control-sm" /></div>
@@ -144,7 +145,7 @@ else
raw tags. Datatype/access are inherited (read-only) from the backing raw tag; the display-name
override is the only per-reference editable field. *@
<section class="panel rise" style="animation-delay:.02s">
<div class="panel-head">Tag references</div>
<h2 class="panel-head">Tag references</h2>
<div style="padding:1rem">
<div class="d-flex justify-content-end align-items-center gap-2 mb-2">
<button type="button" class="btn btn-outline-primary btn-sm" @onclick="OpenAddReference">+ Add reference</button>
@@ -163,12 +164,12 @@ else
}
else
{
<div class="table-wrap">
<table class="table table-sm align-middle mb-0">
<div class="table-wrap" role="region" aria-label="Equipment tag references" tabindex="0">
<table class="data-table">
<thead>
<tr>
<th>Effective name</th><th>Raw path</th><th>Data type</th><th>Access</th>
<th>Display-name override</th><th class="text-end">Actions</th>
<th scope="col">Effective name</th><th scope="col">Raw path</th><th scope="col">Data type</th><th scope="col">Access</th>
<th scope="col">Display-name override</th><th scope="col" class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@@ -206,7 +207,7 @@ else
else if (_activeTab == "vtags")
{
<section class="panel rise" style="animation-delay:.02s">
<div class="panel-head">Virtual tags</div>
<h2 class="panel-head">Virtual tags</h2>
<div style="padding:1rem">
<div class="d-flex justify-content-end mb-2">
<button type="button" class="btn btn-outline-primary btn-sm" @onclick="OpenAddVirtualTag">Add virtual tag</button>
@@ -225,10 +226,10 @@ else
}
else
{
<div class="table-wrap">
<table class="table table-sm mb-0">
<div class="table-wrap" role="region" aria-label="Equipment virtual tags" tabindex="0">
<table class="data-table">
<thead>
<tr><th>Name</th><th>Data type</th><th>Script</th><th>Enabled</th><th class="text-end">Actions</th></tr>
<tr><th scope="col">Name</th><th scope="col">Data type</th><th scope="col">Script</th><th scope="col">Enabled</th><th scope="col" class="text-end">Actions</th></tr>
</thead>
<tbody>
@foreach (var v in _vtags)
@@ -260,7 +261,7 @@ else
else if (_activeTab == "alarms")
{
<section class="panel rise" style="animation-delay:.02s">
<div class="panel-head">Scripted alarms</div>
<h2 class="panel-head">Scripted alarms</h2>
<div style="padding:1rem">
<div class="d-flex justify-content-end mb-2">
<button type="button" class="btn btn-outline-primary btn-sm" @onclick="OpenAddAlarm">Add alarm</button>
@@ -279,10 +280,10 @@ else
}
else
{
<div class="table-wrap">
<table class="table table-sm mb-0">
<div class="table-wrap" role="region" aria-label="Equipment scripted alarms" tabindex="0">
<table class="data-table">
<thead>
<tr><th>Name</th><th>Type</th><th>Severity</th><th>Predicate</th><th>Enabled</th><th class="text-end">Actions</th></tr>
<tr><th scope="col">Name</th><th scope="col">Type</th><th scope="col">Severity</th><th scope="col">Predicate</th><th scope="col">Enabled</th><th scope="col" class="text-end">Actions</th></tr>
</thead>
<tbody>
@foreach (var a in _alarms)