diff --git a/docs/v2/lmx-followups.md b/docs/v2/lmx-followups.md index 11ca514..d5b91eb 100644 --- a/docs/v2/lmx-followups.md +++ b/docs/v2/lmx-followups.md @@ -108,13 +108,30 @@ condition node). Alarm tracking already has its own integration test (`AlarmSubscription*`); the multi-driver alarm case would need a stub `IAlarmSource` that's worth its own focused PR. -## 7. Host-status per-AppEngine granularity → Admin UI dashboard +## 7. Host-status per-AppEngine granularity → Admin UI dashboard — **DONE (PRs 33 + 34)** -**Status**: PR 13 ships per-platform/per-AppEngine `ScanState` probing; PR 17 -surfaces the resulting `OnHostStatusChanged` events through OPC UA. Admin -UI doesn't render a per-host dashboard yet. +**PR 33** landed the data layer: `DriverHostStatus` entity + migration with +composite key `(NodeId, DriverInstanceId, HostName)` and two query-supporting +indexes (per-cluster drill-down on `NodeId`, stale-row detection on +`LastSeenUtc`). -**To do**: -- SignalR hub push of `HostStatusChangedEventArgs` to the Admin UI. -- Dashboard page showing each tracked host, current state, last transition - time, failure count. +**PR 34** wired the publisher + consumer. `HostStatusPublisher` is a +`BackgroundService` in the Server process that walks every registered +`IHostConnectivityProbe`-capable driver every 10s, calls +`GetHostStatuses()`, and upserts rows (`LastSeenUtc` advances each tick; +`State` + `StateChangedUtc` update on transitions). Admin UI `/hosts` page +groups by cluster, shows four summary cards (Hosts / Running / Stale / +Faulted), and flags rows whose `LastSeenUtc` is older than 30s as Stale so +operators see crashed Servers without waiting for a state change. + +Deferred as follow-ups: + +- Event-driven push (subscribe to `OnHostStatusChanged` per driver for + sub-heartbeat latency). Adds DriverHost lifecycle-event plumbing; + 10s polling is fine for operator-scale use. +- Failure-count column — needs the publisher to track a transition history + per host, not just current-state. +- SignalR fan-out to the Admin page (currently the page polls the DB, not + a hub). The DB-polled version is fine at current cadence but a hub push + would eliminate the 10s race where a new row sits in the DB before the + Admin page notices. diff --git a/src/ZB.MOM.WW.OtOpcUa.Admin/Components/Layout/MainLayout.razor b/src/ZB.MOM.WW.OtOpcUa.Admin/Components/Layout/MainLayout.razor index 03540ed..90687dc 100644 --- a/src/ZB.MOM.WW.OtOpcUa.Admin/Components/Layout/MainLayout.razor +++ b/src/ZB.MOM.WW.OtOpcUa.Admin/Components/Layout/MainLayout.razor @@ -6,6 +6,7 @@