Scope alarm tracking to selected templates and surface endpoint/security state on the dashboard so operators can deploy in large galaxies without drowning clients in irrelevant alarms or guessing what the server is advertising

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-04-13 09:48:57 -04:00
parent c5ed5312a9
commit 517d92c76f
25 changed files with 1511 additions and 12 deletions

View File

@@ -154,6 +154,50 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Status
html.ShouldContain("<h2>Alarms</h2>");
}
/// <summary>
/// The Endpoints panel renders in the HTML dashboard even when no server host has been set,
/// so operators can tell the OPC UA server has not started.
/// </summary>
[Fact]
public void GenerateHtml_IncludesEndpointsPanel()
{
var sut = CreateService();
var html = sut.GenerateHtml();
html.ShouldContain("<h2>Endpoints</h2>");
html.ShouldContain("OPC UA server not started");
}
/// <summary>
/// The dashboard JSON surfaces the alarm filter counters so monitoring clients can verify scope.
/// </summary>
[Fact]
public void GenerateJson_Alarms_IncludesFilterCounters()
{
var sut = CreateService();
var json = sut.GenerateJson();
json.ShouldContain("FilterEnabled");
json.ShouldContain("FilterPatternCount");
json.ShouldContain("FilterIncludedObjectCount");
}
/// <summary>
/// The dashboard JSON surfaces the Endpoints section with base-address and security-profile slots
/// so monitoring clients can read them programmatically.
/// </summary>
[Fact]
public void GenerateJson_Endpoints_IncludesBaseAddressesAndSecurityProfiles()
{
var sut = CreateService();
var json = sut.GenerateJson();
json.ShouldContain("Endpoints");
json.ShouldContain("BaseAddresses");
json.ShouldContain("SecurityProfiles");
json.ShouldContain("UserTokenPolicies");
}
/// <summary>
/// The /api/health payload exposes Historian and Alarms component status.
/// </summary>