Add USB, Notifications, Network plugins and reusable EmployeeSearch component
New Plugins: - USB plugin: Device checkout/checkin with employee lookup, checkout history - Notifications plugin: Announcements with types, scheduling, shopfloor display - Network plugin: Network device management with subnets and VLANs - Equipment and Computers plugins: Asset type separation Frontend: - EmployeeSearch component: Reusable employee lookup with autocomplete - USB views: List, detail, checkout/checkin modals - Notifications views: List, form with recognition mode - Network views: Device list, detail, form - Calendar view with FullCalendar integration - Shopfloor and TV dashboard views - Reports index page - Map editor for asset positioning - Light/dark mode fixes for map tooltips Backend: - Employee search API with external lookup service - Collector API for PowerShell data collection - Reports API endpoints - Slides API for TV dashboard - Fixed AppVersion model (removed BaseModel inheritance) - Added checkout_name column to usbcheckouts table Styling: - Unified detail page styles - Improved pagination (page numbers instead of prev/next) - Dark/light mode theme improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -172,7 +172,7 @@ export const locationsApi = {
|
||||
// Printers API
|
||||
export const printersApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/printers/', { params })
|
||||
return api.get('/printers', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/printers/${id}`)
|
||||
@@ -390,3 +390,267 @@ export const knowledgebaseApi = {
|
||||
return api.get('/knowledgebase/stats')
|
||||
}
|
||||
}
|
||||
|
||||
// Assets API (unified)
|
||||
export const assetsApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/assets', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/assets/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/assets', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/assets/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/assets/${id}`)
|
||||
},
|
||||
getMap(params = {}) {
|
||||
return api.get('/assets/map', { params })
|
||||
},
|
||||
// Relationships
|
||||
getRelationships(id) {
|
||||
return api.get(`/assets/${id}/relationships`)
|
||||
},
|
||||
createRelationship(data) {
|
||||
return api.post('/assets/relationships', data)
|
||||
},
|
||||
deleteRelationship(relationshipId) {
|
||||
return api.delete(`/assets/relationships/${relationshipId}`)
|
||||
},
|
||||
// Search assets (for relationship picker)
|
||||
search(query, params = {}) {
|
||||
return api.get('/assets', { params: { search: query, ...params } })
|
||||
},
|
||||
// Lookup asset by asset/machine number
|
||||
lookup(assetnumber) {
|
||||
return api.get(`/assets/lookup/${encodeURIComponent(assetnumber)}`)
|
||||
},
|
||||
types: {
|
||||
list() {
|
||||
return api.get('/assets/types')
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/assets/types/${id}`)
|
||||
}
|
||||
},
|
||||
statuses: {
|
||||
list() {
|
||||
return api.get('/assets/statuses')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notifications API
|
||||
export const notificationsApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/notifications', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/notifications/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/notifications', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/notifications/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/notifications/${id}`)
|
||||
},
|
||||
getActive() {
|
||||
return api.get('/notifications/active')
|
||||
},
|
||||
getCalendar(params = {}) {
|
||||
return api.get('/notifications/calendar', { params })
|
||||
},
|
||||
dashboardSummary() {
|
||||
return api.get('/notifications/dashboard/summary')
|
||||
},
|
||||
getShopfloor(params = {}) {
|
||||
return api.get('/notifications/shopfloor', { params })
|
||||
},
|
||||
getEmployeeRecognitions(sso) {
|
||||
return api.get(`/notifications/employee/${sso}`)
|
||||
},
|
||||
types: {
|
||||
list() {
|
||||
return api.get('/notifications/types')
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/notifications/types', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// USB Devices API
|
||||
export const usbApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/usb', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/usb/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/usb', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/usb/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/usb/${id}`)
|
||||
},
|
||||
checkout(id, data) {
|
||||
return api.post(`/usb/${id}/checkout`, data)
|
||||
},
|
||||
checkin(id, data = {}) {
|
||||
return api.post(`/usb/${id}/checkin`, data)
|
||||
},
|
||||
getHistory(id, params = {}) {
|
||||
return api.get(`/usb/${id}/history`, { params })
|
||||
},
|
||||
getAvailable() {
|
||||
return api.get('/usb/available')
|
||||
},
|
||||
getCheckedOut() {
|
||||
return api.get('/usb/checkedout')
|
||||
},
|
||||
getUserCheckouts(userId) {
|
||||
return api.get(`/usb/user/${userId}`)
|
||||
},
|
||||
dashboardSummary() {
|
||||
return api.get('/usb/dashboard/summary')
|
||||
},
|
||||
types: {
|
||||
list() {
|
||||
return api.get('/usb/types')
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/usb/types', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reports API
|
||||
export const reportsApi = {
|
||||
list() {
|
||||
return api.get('/reports')
|
||||
},
|
||||
equipmentByType(params = {}) {
|
||||
return api.get('/reports/equipment-by-type', { params })
|
||||
},
|
||||
assetsByStatus(params = {}) {
|
||||
return api.get('/reports/assets-by-status', { params })
|
||||
},
|
||||
kbPopularity(params = {}) {
|
||||
return api.get('/reports/kb-popularity', { params })
|
||||
},
|
||||
warrantyStatus(params = {}) {
|
||||
return api.get('/reports/warranty-status', { params })
|
||||
},
|
||||
softwareCompliance(params = {}) {
|
||||
return api.get('/reports/software-compliance', { params })
|
||||
},
|
||||
assetInventory(params = {}) {
|
||||
return api.get('/reports/asset-inventory', { params })
|
||||
}
|
||||
}
|
||||
|
||||
// Employees API (wjf_employees database)
|
||||
export const employeesApi = {
|
||||
search(query, limit = 10) {
|
||||
return api.get('/employees/search', { params: { q: query, limit } })
|
||||
},
|
||||
lookup(sso) {
|
||||
return api.get(`/employees/lookup/${sso}`)
|
||||
},
|
||||
lookupMultiple(ssoList) {
|
||||
return api.get('/employees/lookup', { params: { sso: ssoList } })
|
||||
}
|
||||
}
|
||||
|
||||
// Alias for different casing
|
||||
export const businessUnitsApi = businessunitsApi
|
||||
|
||||
// Network API (devices, subnets, and VLANs)
|
||||
export const networkApi = {
|
||||
// Network devices
|
||||
list(params = {}) {
|
||||
return api.get('/network', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/network/${id}`)
|
||||
},
|
||||
getByAsset(assetId) {
|
||||
return api.get(`/network/by-asset/${assetId}`)
|
||||
},
|
||||
getByHostname(hostname) {
|
||||
return api.get(`/network/by-hostname/${hostname}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/network', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/network/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/network/${id}`)
|
||||
},
|
||||
dashboardSummary() {
|
||||
return api.get('/network/dashboard/summary')
|
||||
},
|
||||
// Network device types
|
||||
types: {
|
||||
list(params = {}) {
|
||||
return api.get('/network/types', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/network/types/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/network/types', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/network/types/${id}`, data)
|
||||
}
|
||||
},
|
||||
// VLANs
|
||||
vlans: {
|
||||
list(params = {}) {
|
||||
return api.get('/network/vlans', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/network/vlans/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/network/vlans', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/network/vlans/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/network/vlans/${id}`)
|
||||
}
|
||||
},
|
||||
// Subnets
|
||||
subnets: {
|
||||
list(params = {}) {
|
||||
return api.get('/network/subnets', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/network/subnets/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/network/subnets', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/network/subnets/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/network/subnets/${id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user