From 53c1f6476c66b690c5db7bdb63d2c5c2e697f543 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Wed, 5 Aug 2026 13:16:41 -0400 Subject: [PATCH] Pick a network device's map position, and stop hardcoding one site's label prefix Two things a second site ran into. The network device form asked for the map position as two raw numbers, so placing a device meant reading coordinates off another screen and typing them in. Machines, PCs and printers have had a "Set Location on Map" picker all along, and the network API already accepted mapx and mapy - only the form was missing. Same picker, same modal. The 3D parts kiosk hardcoded 'WJ' as the prefix shown before the number box, with a comment inviting whoever needed something else to edit the source. That is West Jefferson's gage-lab tag format and nobody else's, so another site's operators were told to expect letters that are not on their labels. It is now printedparts_label_prefix, set in Settings, defaulting to EMPTY - a site that has not set one sees no prefix rather than inheriting another site's convention. West Jefferson sets it to WJ once. The kiosk hides the prefix entirely when unset and falls back to no prefix if the setting cannot be read, because a cosmetic hint must never stop a kiosk working. Not to be confused with printedparts_code_prefix, which mints item codes like 3DP0042 and was already configurable. That is the code we generate; this is the tag already printed on the label. --- .../frontend/views/NetworkDeviceForm.vue | 74 ++++++++++++++----- .../frontend/views/PartsKiosk.vue | 28 +++++-- .../frontend/views/PrintedPartsSettings.vue | 13 ++++ plugins/printedparts/plugin.py | 4 + 4 files changed, 93 insertions(+), 26 deletions(-) diff --git a/plugins/network/frontend/views/NetworkDeviceForm.vue b/plugins/network/frontend/views/NetworkDeviceForm.vue index 605144b..87fc027 100644 --- a/plugins/network/frontend/views/NetworkDeviceForm.vue +++ b/plugins/network/frontend/views/NetworkDeviceForm.vue @@ -205,30 +205,41 @@
Map Position (Optional) -
-
- - -
-
- - + +
+ +
+
+ Position: {{ form.mapx }}, {{ form.mapy }} + +
+
+ + +
+ +
+ +
+
Notes @@ -274,11 +285,16 @@ import { businessunitsApi } from '@/api' import CustomFieldsInputs from '@/components/CustomFieldsInputs.vue' +import ShopFloorMap from '@/components/ShopFloorMap.vue' +import Modal from '@/components/Modal.vue' +import { currentTheme } from '@/stores/theme' import { useIdentifierFlags } from '@/composables/identifierSettings' import { apiError } from '@/utils/apiError' const { isEnabled } = useIdentifierFlags() +const showMapPicker = ref(false) +const tempMapPosition = ref(null) const route = useRoute() const router = useRouter() @@ -483,6 +499,24 @@ function cancel() { router.push('/network') } } +function handlePositionPicked(position) { + tempMapPosition.value = position +} + +function confirmMapPosition() { + if (tempMapPosition.value) { + form.value.mapx = tempMapPosition.value.left + form.value.mapy = tempMapPosition.value.top + } + showMapPicker.value = false +} + +function clearMapPosition() { + form.value.mapx = null + form.value.mapy = null + tempMapPosition.value = null +} +