fix(adminui): canonicalize Modbus driver-type string on "Modbus" (was ModbusTcp)

This commit is contained in:
Joseph Doherty
2026-06-16 19:39:41 -04:00
parent 3fcbc70cba
commit 8b4675b1a5
15 changed files with 28 additions and 23 deletions
@@ -52,7 +52,7 @@ else
private static readonly IReadOnlyDictionary<string, Type> _componentMap =
new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase)
{
["ModbusTcp"] = typeof(ModbusDriverPage),
["Modbus"] = typeof(ModbusDriverPage),
["AbCip"] = typeof(AbCipDriverPage),
["AbLegacy"] = typeof(AbLegacyDriverPage),
["S7"] = typeof(S7DriverPage),
@@ -37,7 +37,7 @@
private static readonly IReadOnlyList<DriverTypeEntry> _types = new[]
{
new DriverTypeEntry("ModbusTcp", "modbustcp", "[M]", "Modbus/TCP — generic registers/coils via port 502."),
new DriverTypeEntry("Modbus TCP", "modbustcp", "[M]", "Modbus/TCP — generic registers/coils via port 502."),
new DriverTypeEntry("AbCip", "abcip", "[CIP]", "Allen-Bradley CompactLogix/ControlLogix via CIP."),
new DriverTypeEntry("AbLegacy", "ablegacy", "[AB]", "Allen-Bradley PLC-5/SLC-500/MicroLogix via DF1."),
new DriverTypeEntry("S7", "s7", "[S7]", "Siemens S7-300/400/1200/1500 via ISO-on-TCP."),
@@ -321,7 +321,7 @@ else
[Parameter] public string ClusterId { get; set; } = "";
[Parameter] public string? DriverInstanceId { get; set; }
private const string DriverTypeKey = "ModbusTcp";
private const string DriverTypeKey = "Modbus";
private bool IsNew => string.IsNullOrEmpty(DriverInstanceId);