From 60e2947fc780438847e25f54963461692cea7b70 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 21 Jul 2026 09:49:14 -0400 Subject: [PATCH] displays: single display type with IP-driven role (dashboard/lobby/kiosk) One 'display' image resolves what it shows from its own IP, like the existing visitor-location BU mapping. Extend DashboardDefault with displayrole (dashboard|lobby|partskiosk; migration 7d28, businessunitid now nullable since only the dashboard role needs one) + a role->path map. New unauthenticated GET /api/dashboarddefaults/display-role returns {role, path, businessunitid} for the caller IP. Settings UI gains a Display selector, showing the business unit only for the dashboard role. --- .../views/settings/DashboardDefaultsList.vue | 33 +++++++-- .../7d28_dashboarddefault_displayrole.py | 63 +++++++++++++++++ shopdb/core/api/dashboarddefaults.py | 68 +++++++++++++++++-- shopdb/core/models/dashboarddefault.py | 30 ++++++-- tests/test_core/test_dashboarddefaults.py | 45 ++++++++++++ 5 files changed, 218 insertions(+), 21 deletions(-) create mode 100644 migrations/versions/7d28_dashboarddefault_displayrole.py diff --git a/frontend/src/views/settings/DashboardDefaultsList.vue b/frontend/src/views/settings/DashboardDefaultsList.vue index 17a9b64..04fd157 100644 --- a/frontend/src/views/settings/DashboardDefaultsList.vue +++ b/frontend/src/views/settings/DashboardDefaultsList.vue @@ -6,9 +6,9 @@

- Map a kiosk/lobby display's IP address to the business unit it should show. - The shopfloor dashboard auto-selects this business unit by the display's IP - when none is chosen. + Map a display PC's IP address to what it should show: the shopfloor + dashboard (and which business unit), the lobby slideshow, or the 3D parts + kiosk. A single "display" image resolves its role from its own IP.

@@ -20,6 +20,7 @@ IP Address + Display Business Unit Description Actions @@ -28,6 +29,7 @@ {{ d.ipaddress }} + {{ roleLabel(d.displayrole) }} {{ d.businessunit || '-' }} {{ d.description || '-' }} @@ -36,7 +38,7 @@ - + No mappings yet @@ -60,8 +62,15 @@ placeholder="e.g., 10.20.30.40" required />
+ + +
+
-