Let a person edit the asset fields the pages already display
All checks were successful
CI / naming (push) Successful in 4s
CI / frontend (push) Successful in 13s
CI / migrations-mysql (push) Successful in 42s
CI / backend (push) Successful in 4m19s

Eight fields across three asset types were shown on the detail page and
accepted by the API, but had no input on the form. A wrong value therefore
needed database access to correct, which is not a thing anybody should need
for a device category or a maintenance date.

The shape is the same in each case: a column was added, the detail card was
written, the API allowlist was updated, and the form was missed. Nothing was
broken - the values arrive by import or collector - so nothing complained.

PCs gain azureobjectid and azuredevicecategory. azuredeviceid was already
there, which is what made the omission easy to miss: the page showed two ids
and the form offered one. The two are not interchangeable and the pairing is
counterintuitive - the DEVICE id opens Intune, the OBJECT id opens Entra - so
each input says where it goes.

Machines gain the three maintenance fields. These matter beyond the immediate
fix: they are the columns a measuring instrument's calibration dates map onto
when metrology moves to machines, and until now there was no way to enter a
calibration date on a machine at all.

Printers gain iscolor, isduplex and isnetwork as a capability group.
isnetwork defaults to true in the form to match the API's create default; a
new printer claiming otherwise would be wrong for nearly all of them.

Checked before making any of these editable that nothing writes them
automatically - a hand edit silently reverted by the next collector poll would
be worse than no input at all. The printers collector reports queues and
supplies, not capabilities, and nothing writes machine maintenance dates,
which is exactly why they are all empty. The two genuinely collector-owned
computer fields, lastreporteddate and lastboottime, are deliberately still not
editable.

Scope: product
This commit is contained in:
cproudlock
2026-09-02 07:53:25 -04:00
parent c8e0de4dc1
commit 1480b30e8c
3 changed files with 120 additions and 2 deletions

View File

@@ -230,7 +230,36 @@
v-model="form.azuredeviceid"
type="text"
class="form-control"
placeholder="Entra/Azure deviceId GUID (set by Azure imports)"
placeholder="Entra deviceId GUID (set by the Azure import)"
/>
<small class="muted">Opens the device in Intune from the PC page.</small>
</div>
<!-- The OBJECT id, not the device id. Entra gives a device both and
they address different places: deviceId opens Intune, objectId
opens the Entra device record. The import populates both, so a
page showing only one left the other uneditable when it was
wrong. -->
<div class="form-group">
<label for="azureobjectid">Azure Object ID</label>
<input
id="azureobjectid"
v-model="form.azureobjectid"
type="text"
class="form-control"
placeholder="Entra objectId GUID (set by the Azure import)"
/>
<small class="muted">Opens the device in Entra from the PC page.</small>
</div>
<div class="form-group">
<label for="azuredevicecategory">Azure Device Category</label>
<input
id="azuredevicecategory"
v-model="form.azuredevicecategory"
type="text"
class="form-control"
placeholder="Entra device category or group label"
/>
</div>
@@ -395,6 +424,8 @@ const form = ref({
osid: '',
loggedinuser: '',
azuredeviceid: '',
azureobjectid: '',
azuredevicecategory: '',
accessmethods: [],
notes: '',
mapx: null,
@@ -529,6 +560,8 @@ onMounted(async () => {
osid: ext.osid || '',
loggedinuser: ext.loggedinuser || '',
azuredeviceid: ext.azuredeviceid || '',
azureobjectid: ext.azureobjectid || '',
azuredevicecategory: ext.azuredevicecategory || '',
accessmethods: (pc.accessmethods || []).map(a => ({
protocolid: a.protocolid,
portoverride: a.portoverride ?? null
@@ -605,6 +638,8 @@ async function savePC() {
osid: form.value.osid || null,
loggedinuser: form.value.loggedinuser || null,
azuredeviceid: form.value.azuredeviceid || null,
azureobjectid: form.value.azureobjectid || null,
azuredevicecategory: form.value.azuredevicecategory || null,
accessmethods: form.value.accessmethods,
notes: form.value.notes || null,
ipaddress: form.value.ipaddress || null,