Add print badges, pagination, route splitting, JWT auth fixes, and list page alignment

- Fix equipment badge barcode not rendering (loading race condition)
- Fix printer QR code not rendering on initial load (same race condition)
- Add model image to equipment badge via imageurl from Model table
- Fix white-on-white machine number text on badge, tighten barcode spacing
- Add PaginationBar component used across all list pages
- Split monolithic router into per-plugin route modules
- Fix 25 GET API endpoints returning 401 (jwt_required -> optional=True)
- Align list page columns across Equipment, PCs, and Network pages
- Add print views: EquipmentBadge, PrinterQRSingle, PrinterQRBatch, USBLabelBatch
- Add PC Relationships report, migration docs, and CLAUDE.md project guide
- Various plugin model, API, and frontend refinements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-02-04 07:32:44 -05:00
parent fe7a00b260
commit 83caaa7b7c
89 changed files with 3951 additions and 1138 deletions

View File

@@ -1,354 +1,54 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useAuthStore } from '../stores/auth'
// Views
import Login from '../views/Login.vue'
import AppLayout from '../views/AppLayout.vue'
import Dashboard from '../views/Dashboard.vue'
import MachinesList from '../views/machines/MachinesList.vue'
import MachineDetail from '../views/machines/MachineDetail.vue'
import MachineForm from '../views/machines/MachineForm.vue'
import PrintersList from '../views/printers/PrintersList.vue'
import PrinterDetail from '../views/printers/PrinterDetail.vue'
import PrinterForm from '../views/printers/PrinterForm.vue'
import PCsList from '../views/pcs/PCsList.vue'
import PCDetail from '../views/pcs/PCDetail.vue'
import PCForm from '../views/pcs/PCForm.vue'
import VendorsList from '../views/vendors/VendorsList.vue'
import ApplicationsList from '../views/applications/ApplicationsList.vue'
import ApplicationDetail from '../views/applications/ApplicationDetail.vue'
import ApplicationForm from '../views/applications/ApplicationForm.vue'
import KnowledgeBaseList from '../views/knowledgebase/KnowledgeBaseList.vue'
import KnowledgeBaseDetail from '../views/knowledgebase/KnowledgeBaseDetail.vue'
import KnowledgeBaseForm from '../views/knowledgebase/KnowledgeBaseForm.vue'
import SearchResults from '../views/SearchResults.vue'
import NotificationsList from '../views/notifications/NotificationsList.vue'
import NotificationForm from '../views/notifications/NotificationForm.vue'
import USBList from '../views/usb/USBList.vue'
import USBDetail from '../views/usb/USBDetail.vue'
import USBForm from '../views/usb/USBForm.vue'
import NetworkDevicesList from '../views/network/NetworkDevicesList.vue'
import NetworkDeviceDetail from '../views/network/NetworkDeviceDetail.vue'
import NetworkDeviceForm from '../views/network/NetworkDeviceForm.vue'
import ReportsIndex from '../views/reports/ReportsIndex.vue'
import CalendarView from '../views/CalendarView.vue'
import SettingsIndex from '../views/settings/SettingsIndex.vue'
import MachineTypesList from '../views/settings/MachineTypesList.vue'
import LocationsList from '../views/settings/LocationsList.vue'
import StatusesList from '../views/settings/StatusesList.vue'
import ModelsList from '../views/settings/ModelsList.vue'
import PCTypesList from '../views/settings/PCTypesList.vue'
import OperatingSystemsList from '../views/settings/OperatingSystemsList.vue'
import BusinessUnitsList from '../views/settings/BusinessUnitsList.vue'
import VLANsList from '../views/settings/VLANsList.vue'
import SubnetsList from '../views/settings/SubnetsList.vue'
import MapView from '../views/MapView.vue'
import MapEditor from '../views/MapEditor.vue'
import ShopfloorDashboard from '../views/ShopfloorDashboard.vue'
import TVDashboard from '../views/TVDashboard.vue'
import EmployeeDetail from '../views/employees/EmployeeDetail.vue'
// Auto-discover all route modules from routes/ directory
const routeModules = import.meta.glob('./routes/*.js', { eager: true })
const appChildren = Object.values(routeModules).flatMap(m => m.default)
const routes = [
{
path: '/login',
name: 'login',
component: Login,
component: () => import('../views/Login.vue'),
meta: { guest: true }
},
// Standalone full-screen dashboards (no sidebar, no auth required)
{
path: '/shopfloor',
name: 'shopfloor',
component: ShopfloorDashboard
component: () => import('../views/ShopfloorDashboard.vue')
},
{
path: '/tv',
name: 'tv',
component: TVDashboard
component: () => import('../views/TVDashboard.vue')
},
// Print pages (standalone, no sidebar/header)
{
path: '/print/equipment-badge/:id',
name: 'print-equipment-badge',
component: () => import('../views/print/EquipmentBadge.vue')
},
{
path: '/print/printer-qr',
name: 'print-printer-qr-batch',
component: () => import('../views/print/PrinterQRBatch.vue')
},
{
path: '/print/printer-qr/:id',
name: 'print-printer-qr-single',
component: () => import('../views/print/PrinterQRSingle.vue')
},
{
path: '/print/usb-labels',
name: 'print-usb-labels',
component: () => import('../views/print/USBLabelBatch.vue')
},
{
path: '/',
component: AppLayout,
children: [
{
path: '',
name: 'dashboard',
component: Dashboard
},
{
path: 'search',
name: 'search',
component: SearchResults
},
{
path: 'machines',
name: 'machines',
component: MachinesList
},
{
path: 'machines/new',
name: 'machine-new',
component: MachineForm,
meta: { requiresAuth: true }
},
{
path: 'machines/:id',
name: 'machine-detail',
component: MachineDetail
},
{
path: 'machines/:id/edit',
name: 'machine-edit',
component: MachineForm,
meta: { requiresAuth: true }
},
{
path: 'printers',
name: 'printers',
component: PrintersList
},
{
path: 'printers/new',
name: 'printer-new',
component: PrinterForm,
meta: { requiresAuth: true }
},
{
path: 'printers/:id',
name: 'printer-detail',
component: PrinterDetail
},
{
path: 'printers/:id/edit',
name: 'printer-edit',
component: PrinterForm,
meta: { requiresAuth: true }
},
{
path: 'pcs',
name: 'pcs',
component: PCsList
},
{
path: 'pcs/new',
name: 'pc-new',
component: PCForm,
meta: { requiresAuth: true }
},
{
path: 'pcs/:id',
name: 'pc-detail',
component: PCDetail
},
{
path: 'pcs/:id/edit',
name: 'pc-edit',
component: PCForm,
meta: { requiresAuth: true }
},
{
path: 'map',
name: 'map',
component: MapView
},
{
path: 'map/editor',
name: 'map-editor',
component: MapEditor,
meta: { requiresAuth: true }
},
{
path: 'applications',
name: 'applications',
component: ApplicationsList
},
{
path: 'applications/new',
name: 'application-new',
component: ApplicationForm,
meta: { requiresAuth: true }
},
{
path: 'applications/:id',
name: 'application-detail',
component: ApplicationDetail
},
{
path: 'applications/:id/edit',
name: 'application-edit',
component: ApplicationForm,
meta: { requiresAuth: true }
},
{
path: 'knowledgebase',
name: 'knowledgebase',
component: KnowledgeBaseList
},
{
path: 'knowledgebase/new',
name: 'knowledgebase-new',
component: KnowledgeBaseForm,
meta: { requiresAuth: true }
},
{
path: 'knowledgebase/:id',
name: 'knowledgebase-detail',
component: KnowledgeBaseDetail
},
{
path: 'knowledgebase/:id/edit',
name: 'knowledgebase-edit',
component: KnowledgeBaseForm,
meta: { requiresAuth: true }
},
{
path: 'notifications',
name: 'notifications',
component: NotificationsList
},
{
path: 'notifications/new',
name: 'notification-new',
component: NotificationForm,
meta: { requiresAuth: true }
},
{
path: 'notifications/:id',
name: 'notification-detail',
component: NotificationForm
},
{
path: 'notifications/:id/edit',
name: 'notification-edit',
component: NotificationForm,
meta: { requiresAuth: true }
},
{
path: 'usb',
name: 'usb',
component: USBList
},
{
path: 'usb/new',
name: 'usb-new',
component: USBForm,
meta: { requiresAuth: true }
},
{
path: 'usb/:id',
name: 'usb-detail',
component: USBDetail
},
{
path: 'usb/:id/edit',
name: 'usb-edit',
component: USBForm,
meta: { requiresAuth: true }
},
{
path: 'network',
name: 'network',
component: NetworkDevicesList
},
{
path: 'network/new',
name: 'network-new',
component: NetworkDeviceForm,
meta: { requiresAuth: true }
},
{
path: 'network/:id',
name: 'network-detail',
component: NetworkDeviceDetail
},
{
path: 'network/:id/edit',
name: 'network-edit',
component: NetworkDeviceForm,
meta: { requiresAuth: true }
},
{
path: 'reports',
name: 'reports',
component: ReportsIndex
},
{
path: 'calendar',
name: 'calendar',
component: CalendarView
},
{
path: 'settings',
name: 'settings',
component: SettingsIndex,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/vendors',
name: 'vendors',
component: VendorsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/machinetypes',
name: 'machinetypes',
component: MachineTypesList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/locations',
name: 'locations',
component: LocationsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/statuses',
name: 'statuses',
component: StatusesList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/models',
name: 'models',
component: ModelsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/pctypes',
name: 'pctypes',
component: PCTypesList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/operatingsystems',
name: 'operatingsystems',
component: OperatingSystemsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/businessunits',
name: 'businessunits',
component: BusinessUnitsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/vlans',
name: 'vlans',
component: VLANsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'settings/subnets',
name: 'subnets',
component: SubnetsList,
meta: { requiresAuth: true, requiresAdmin: true }
},
{
path: 'employees/:sso',
name: 'employee-detail',
component: EmployeeDetail
}
]
children: appChildren
}
]