From 85931db0facd8eabe27f0564298990323f0f4e79 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Thu, 20 Aug 2026 15:10:01 -0400 Subject: [PATCH] Network devices: filter models by vendor, and style the hero like every other page Three fixes, all of them a page not doing what its siblings already do. MODELS WERE NOT FILTERED BY VENDOR. PCForm, MachineForm and PrinterForm each narrow the model list once a vendor is chosen; NetworkDeviceForm bound the whole catalogue, so picking Palo Alto still offered every Dell and Zebra model. Same computed as the others, including the same rule that no vendor selected shows everything - an empty dropdown reads as "no models exist" when it means "pick a vendor first". Audited the rest: this was the only gap. The other views holding a modelnumberid have no vendor picker to filter against, and settings ModelsList is where a model's vendor is ASSIGNED, where filtering would be circular. THE HERO RAN THE LABEL INTO THE VALUE - "Asset #FW-OAV..." as one string. The page used detail-item / label / value, which match nothing in the stylesheet, so the two spans got no layout at all. Every other detail page uses hero-detail / hero-detail-label / hero-detail-value, which stacks a small uppercase label above the value. Renamed to those; no CSS added, because the styles already existed and this page simply was not using them. It was the last page using the unstyled names. MACHINES LIST LINKED BY THE WRONG ID on its fallback path. `/machines/:id` keys on machineid, the plugin extension id, and the row click and View button fell back to `item.assetid` - which lands on whichever machine happens to carry that number: a wrong page that looks right, which is worse than a 404. That defect has been fixed twice before in other views (AssetRelationships, then the GE-Enforce reports table) and BackupHistory carries a comment warning about it; this was the fourth copy. The list endpoint always sets item.machine, so the fallback could not actually fire here - it is removed as a latent trap rather than a live bug, and with no machineid the cell now shows plain text rather than a link that misleads. --- .../machines/frontend/views/MachinesList.vue | 14 ++++++++-- .../frontend/views/NetworkDeviceDetail.vue | 28 +++++++++++-------- .../frontend/views/NetworkDeviceForm.vue | 11 +++++++- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/plugins/machines/frontend/views/MachinesList.vue b/plugins/machines/frontend/views/MachinesList.vue index b02123e..19732aa 100644 --- a/plugins/machines/frontend/views/MachinesList.vue +++ b/plugins/machines/frontend/views/MachinesList.vue @@ -36,7 +36,9 @@ - + {{ item.assetnumber }} @@ -58,12 +60,20 @@ {{ item.locationname || '-' }} + View + - diff --git a/plugins/network/frontend/views/NetworkDeviceDetail.vue b/plugins/network/frontend/views/NetworkDeviceDetail.vue index 3e984f1..6921b40 100644 --- a/plugins/network/frontend/views/NetworkDeviceDetail.vue +++ b/plugins/network/frontend/views/NetworkDeviceDetail.vue @@ -33,22 +33,26 @@ {{ heroWarranty.label }} +
-
- Asset # - {{ device.assetnumber }} +
+ Asset # + {{ device.assetnumber }}
-
- Serial - {{ device.serialnumber }} +
+ Serial + {{ device.serialnumber }}
-
- Location - {{ device.locationname }} +
+ Location + {{ device.locationname }}
-
- Business Unit - {{ device.businessunitname }} +
+ Business Unit + {{ device.businessunitname }}
diff --git a/plugins/network/frontend/views/NetworkDeviceForm.vue b/plugins/network/frontend/views/NetworkDeviceForm.vue index c53b7a9..526e9d9 100644 --- a/plugins/network/frontend/views/NetworkDeviceForm.vue +++ b/plugins/network/frontend/views/NetworkDeviceForm.vue @@ -161,7 +161,7 @@ @@ -395,6 +395,15 @@ const generatedAssetNumber = computed(() => { }) const vendors = ref([]) const models = ref([]) + +// Models belong to a vendor, so picking one narrows the list - the same +// behaviour PCForm, MachineForm and PrinterForm have. With no vendor chosen the +// whole catalogue shows, rather than an empty dropdown that reads as "no models +// exist" when it means "pick a vendor first". +const filteredModels = computed(() => { + if (!form.value.vendorid) return models.value + return models.value.filter(m => m.vendorid === form.value.vendorid) +}) const locations = ref([]) const statuses = ref([]) const businessUnits = ref([])