feat(adminui): writable checkbox in driver-typed tag editors (R2-11, 05/UNDER-6)

Models gain an optional bool? Writable (absent stays omitted; explicit false round-trips,
unknown keys preserved); the six editors gain a Writable checkbox (FOCAS disabled+read-only
hint). 9 model round-trip tests green. docker-dev /run verify of one editor deferred-live.
This commit is contained in:
Joseph Doherty
2026-07-13 11:22:12 -04:00
parent 4260b6ecaa
commit 4449baac69
14 changed files with 174 additions and 1 deletions
@@ -17,6 +17,14 @@
<select class="form-select form-select-sm" value="@_m.DataType" @onchange="@(e => Update(() => _m.DataType = ParseEnum(e.Value, AbCipDataType.DInt)))">
@foreach (var v in Enum.GetValues<AbCipDataType>()) { <option value="@v">@v</option> }
</select></div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="abcip-writable"
checked="@(_m.Writable ?? true)"
@onchange="@(e => Update(() => _m.Writable = e.Value is bool b && b))" />
<label class="form-check-label small" for="abcip-writable">Writable (uncheck for a read-only tag)</label>
</div>
</div>
</div>
@if (_showPicker)
@@ -17,6 +17,14 @@
<select class="form-select form-select-sm" value="@_m.DataType" @onchange="@(e => Update(() => _m.DataType = ParseEnum(e.Value, AbLegacyDataType.Int)))">
@foreach (var v in Enum.GetValues<AbLegacyDataType>()) { <option value="@v">@v</option> }
</select></div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="ablegacy-writable"
checked="@(_m.Writable ?? true)"
@onchange="@(e => Update(() => _m.Writable = e.Value is bool b && b))" />
<label class="form-check-label small" for="ablegacy-writable">Writable (uncheck for a read-only tag)</label>
</div>
</div>
</div>
@if (_showPicker)
@@ -17,6 +17,12 @@
<select class="form-select form-select-sm" value="@_m.DataType" @onchange="@(e => Update(() => _m.DataType = ParseEnum(e.Value, FocasDataType.Int32)))">
@foreach (var v in Enum.GetValues<FocasDataType>()) { <option value="@v">@v</option> }
</select></div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="focas-writable" disabled checked="false" />
<label class="form-check-label small text-muted" for="focas-writable">Writable — FOCAS writes are unsupported; tags are read-only.</label>
</div>
</div>
</div>
@if (_showPicker)
@@ -25,6 +25,14 @@
<div class="col-12 mt-1">
<button type="button" class="btn btn-sm btn-outline-secondary" @onclick="@(() => _showPicker = true)">Build address</button>
</div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="modbus-writable"
checked="@(_m.Writable ?? true)"
@onchange="@(e => Update(() => _m.Writable = e.Value is bool b && b))" />
<label class="form-check-label small" for="modbus-writable">Writable (uncheck for a read-only tag)</label>
</div>
</div>
</div>
@if (_showPicker)
@@ -17,6 +17,14 @@
</select></div>
<div class="col-md-3"><label class="form-label">String len</label>
<input type="number" class="form-control form-control-sm" value="@_m.StringLength" @onchange="@(e => Update(() => _m.StringLength = ParseInt(e.Value)))" /></div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="s7-writable"
checked="@(_m.Writable ?? true)"
@onchange="@(e => Update(() => _m.Writable = e.Value is bool b && b))" />
<label class="form-check-label small" for="s7-writable">Writable (uncheck for a read-only tag)</label>
</div>
</div>
</div>
@if (_showPicker)
@@ -17,6 +17,14 @@
<select class="form-select form-select-sm" value="@_m.DataType" @onchange="@(e => Update(() => _m.DataType = ParseEnum(e.Value, TwinCATDataType.DInt)))">
@foreach (var v in Enum.GetValues<TwinCATDataType>()) { <option value="@v">@v</option> }
</select></div>
<div class="col-12">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="twincat-writable"
checked="@(_m.Writable ?? true)"
@onchange="@(e => Update(() => _m.Writable = e.Value is bool b && b))" />
<label class="form-check-label small" for="twincat-writable">Writable (uncheck for a read-only tag)</label>
</div>
</div>
</div>
@if (_showPicker)