mbproxy: replace status page with a live SignalR web dashboard
The single auto-refreshing zero-JS status page gave operators a 25-column wall and no way to drill into one connection. This adds a Bootstrap fleet dashboard (filterable/sortable KPI table) and a per-PLC detail page with a real-time debug view of raw PLC-side BCD vs. decoded client-side values, streamed live over a SignalR feed. The debug view is fed by an on-demand per-tag value capture, armed only while a detail page is open. All assets (Bootstrap, SignalR client, fonts) are embedded so the UI works unchanged on firewalled networks; GET /status.json is untouched for scrapers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -141,6 +141,7 @@ internal sealed class BcdPduPipeline : IPduPipeline
|
||||
pdu[3] = (byte)(encoded >> 8);
|
||||
pdu[4] = (byte)(encoded & 0xFF);
|
||||
ctx.Counters.AddRewrittenSlots(1);
|
||||
ctx.Capture?.Record(address, encoded, 0, value, CaptureDirection.Write);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -247,6 +248,7 @@ internal sealed class BcdPduPipeline : IPduPipeline
|
||||
pdu[highByteOff] = (byte)(bcdHigh >> 8);
|
||||
pdu[highByteOff + 1] = (byte)(bcdHigh & 0xFF);
|
||||
ctx.Counters.AddRewrittenSlots(2);
|
||||
ctx.Capture?.Record(tag.Address, bcdLow, bcdHigh, binaryValue, CaptureDirection.Write);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -276,6 +278,7 @@ internal sealed class BcdPduPipeline : IPduPipeline
|
||||
pdu[byteOff] = (byte)(encoded >> 8);
|
||||
pdu[byteOff + 1] = (byte)(encoded & 0xFF);
|
||||
ctx.Counters.AddRewrittenSlots(1);
|
||||
ctx.Capture?.Record(tag.Address, encoded, 0, clientValue, CaptureDirection.Write);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,6 +405,7 @@ internal sealed class BcdPduPipeline : IPduPipeline
|
||||
pdu[highByteOff] = (byte)(decodedHigh >> 8);
|
||||
pdu[highByteOff + 1] = (byte)(decodedHigh & 0xFF);
|
||||
ctx.Counters.AddRewrittenSlots(2);
|
||||
ctx.Capture?.Record(tag.Address, rawLow, rawHigh, decoded, CaptureDirection.Read);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -430,6 +434,7 @@ internal sealed class BcdPduPipeline : IPduPipeline
|
||||
pdu[byteOff] = (byte)(decoded >> 8);
|
||||
pdu[byteOff + 1] = (byte)(decoded & 0xFF);
|
||||
ctx.Counters.AddRewrittenSlots(1);
|
||||
ctx.Capture?.Record(tag.Address, raw, 0, decoded, CaptureDirection.Read);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user