Let a person edit the asset fields the pages already display
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:
@@ -336,6 +336,44 @@
|
||||
|
||||
<!-- Notes Section -->
|
||||
<h3 class="form-section-title">Notes</h3>
|
||||
<!-- Maintenance. Shown on the detail page since it was added but never
|
||||
editable, so a wrong date needed database access to correct. These
|
||||
are the columns a measuring instrument's calibration dates map onto
|
||||
when metrology moves to machines, which is the other reason they
|
||||
have to be enterable. -->
|
||||
<div class="form-group">
|
||||
<label for="lastmaintenancedate">Last Maintenance</label>
|
||||
<input
|
||||
id="lastmaintenancedate"
|
||||
v-model="form.lastmaintenancedate"
|
||||
type="date"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nextmaintenancedate">Next Maintenance</label>
|
||||
<input
|
||||
id="nextmaintenancedate"
|
||||
v-model="form.nextmaintenancedate"
|
||||
type="date"
|
||||
class="form-control"
|
||||
/>
|
||||
<small class="muted">Set directly; it is not derived from the interval.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maintenanceintervaldays">Maintenance Interval (days)</label>
|
||||
<input
|
||||
id="maintenanceintervaldays"
|
||||
v-model.number="form.maintenanceintervaldays"
|
||||
type="number"
|
||||
min="1"
|
||||
class="form-control"
|
||||
placeholder="e.g. 180"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea
|
||||
id="notes"
|
||||
@@ -420,6 +458,9 @@ const form = ref({
|
||||
businessunitid: '',
|
||||
requiresmanualconfig: false,
|
||||
islocationonly: false,
|
||||
lastmaintenancedate: '',
|
||||
nextmaintenancedate: '',
|
||||
maintenanceintervaldays: null,
|
||||
notes: '',
|
||||
mapx: null,
|
||||
mapy: null,
|
||||
@@ -613,6 +654,9 @@ onMounted(async () => {
|
||||
businessunitid: data.businessunitid || '',
|
||||
requiresmanualconfig: data.machine?.requiresmanualconfig || false,
|
||||
islocationonly: data.machine?.islocationonly || false,
|
||||
lastmaintenancedate: (data.machine?.lastmaintenancedate || '').slice(0, 10),
|
||||
nextmaintenancedate: (data.machine?.nextmaintenancedate || '').slice(0, 10),
|
||||
maintenanceintervaldays: data.machine?.maintenanceintervaldays ?? null,
|
||||
notes: data.notes || '',
|
||||
mapx: data.mapx ?? null,
|
||||
mapy: data.mapy ?? null,
|
||||
@@ -714,6 +758,9 @@ async function saveMachine() {
|
||||
businessunitid: form.value.businessunitid || null,
|
||||
requiresmanualconfig: form.value.requiresmanualconfig,
|
||||
islocationonly: form.value.islocationonly,
|
||||
lastmaintenancedate: form.value.lastmaintenancedate || null,
|
||||
nextmaintenancedate: form.value.nextmaintenancedate || null,
|
||||
maintenanceintervaldays: form.value.maintenanceintervaldays || null,
|
||||
notes: form.value.notes || null,
|
||||
mapx: form.value.mapx,
|
||||
mapy: form.value.mapy
|
||||
|
||||
Reference in New Issue
Block a user