Polling chosen over event-driven for initial scope: simpler, matches Admin UI consumer cadence, avoids DriverHost lifecycle-event plumbing that doesn't exist today. Event-driven push for sub-heartbeat latency is a straightforward follow-up. Admin.Services.HostStatusService left-joins DriverHostStatus against ClusterNode on NodeId so rows persist even when the ClusterNode entry doesn't exist yet (first-boot bootstrap case). StaleThreshold = 30s — covers one missed publisher heartbeat plus a generous buffer for clock skew and GC pauses. Admin Components/Pages/Hosts.razor — FleetAdmin-visible page grouped by cluster (handles the '(unassigned)' case for rows without a matching ClusterNode). Four summary cards (Hosts / Running / Stale / Faulted); per-cluster table with Node / Driver / Host / State + Stale-badge / Last-transition / Last-seen / Detail columns; 10s auto-refresh via IServiceScopeFactory timer pattern matching FleetStatusPoller + Fleet dashboard (PR 27). Row-class highlighting: Faulted → table-danger, Stale → table-warning, else default. State badge maps DriverHostState enum to bootstrap color classes. Sidebar link added between 'Fleet status' and 'Clusters'. Server csproj adds Microsoft.EntityFrameworkCore.SqlServer 10.0.0 + registers OtOpcUaConfigDbContext in Program.cs scoped via NodeOptions.ConfigDbConnectionString (no Admin-style manual SQL raw — the DbContext is the only access path, keeps migrations owner-of-record). Tests — HostStatusPublisherTests (4 new Integration cases, uses per-run throwaway DB matching the FleetStatusPollerTests pattern): publisher upserts one row per host from each probe-capable driver and skips non-probe drivers; second tick advances LastSeenUtc without creating duplicate rows (upsert pattern verified end-to-end); state change between ticks updates State AND StateChangedUtc (datetime2(3) rounds to millisecond precision so comparison uses 1ms tolerance — documented inline); MapState translates every HostState enum member. Server.Tests Integration: 4 new tests pass. Admin build clean, Admin.Tests Unit still 23 / 0. docs/v2/lmx-followups.md item #7 marked DONE with three explicit deferred items (event-driven push, failure-count column, SignalR fan-out). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.8 KiB
Plaintext
38 lines
1.8 KiB
Plaintext
@inherits LayoutComponentBase
|
|
|
|
<div class="d-flex" style="min-height: 100vh;">
|
|
<nav class="bg-dark text-light p-3" style="width: 220px;">
|
|
<h5 class="mb-4">OtOpcUa Admin</h5>
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item"><a class="nav-link text-light" href="/">Overview</a></li>
|
|
<li class="nav-item"><a class="nav-link text-light" href="/fleet">Fleet status</a></li>
|
|
<li class="nav-item"><a class="nav-link text-light" href="/hosts">Host status</a></li>
|
|
<li class="nav-item"><a class="nav-link text-light" href="/clusters">Clusters</a></li>
|
|
<li class="nav-item"><a class="nav-link text-light" href="/reservations">Reservations</a></li>
|
|
<li class="nav-item"><a class="nav-link text-light" href="/certificates">Certificates</a></li>
|
|
</ul>
|
|
|
|
<div class="mt-5">
|
|
<AuthorizeView>
|
|
<Authorized>
|
|
<div class="small text-light">
|
|
Signed in as <a class="text-light" href="/account"><strong>@context.User.Identity?.Name</strong></a>
|
|
</div>
|
|
<div class="small text-muted">
|
|
@string.Join(", ", context.User.Claims.Where(c => c.Type.EndsWith("/role")).Select(c => c.Value))
|
|
</div>
|
|
<form method="post" action="/auth/logout">
|
|
<button class="btn btn-sm btn-outline-light mt-2" type="submit">Sign out</button>
|
|
</form>
|
|
</Authorized>
|
|
<NotAuthorized>
|
|
<a class="btn btn-sm btn-outline-light" href="/login">Sign in</a>
|
|
</NotAuthorized>
|
|
</AuthorizeView>
|
|
</div>
|
|
</nav>
|
|
<main class="flex-grow-1 p-4">
|
|
@Body
|
|
</main>
|
|
</div>
|