Add full search parity and optimize map performance
Search: refactor into modular helpers, add IP/hostname/notification/ vendor/model/type search, smart auto-redirects for exact matches, ServiceNOW prefix detection, filter buttons with counts, share links with highlight support, and dark mode badge colors. Map: fix N+1 queries with eager loading (248->28 queries), switch to canvas-rendered circleMarkers for better performance with 500+ assets. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,12 +7,16 @@ const api = axios.create({
|
||||
}
|
||||
})
|
||||
|
||||
// Add auth token to requests
|
||||
// Add auth token and normalize pagination params
|
||||
api.interceptors.request.use(config => {
|
||||
const token = localStorage.getItem('token')
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
}
|
||||
// Send both perpage and per_page for backend compatibility
|
||||
if (config.params?.perpage) {
|
||||
config.params.per_page = config.params.perpage
|
||||
}
|
||||
return config
|
||||
})
|
||||
|
||||
@@ -306,6 +310,9 @@ export const printersApi = {
|
||||
export const dashboardApi = {
|
||||
summary() {
|
||||
return api.get('/dashboard/summary')
|
||||
},
|
||||
navigation() {
|
||||
return api.get('/dashboard/navigation')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,8 +451,8 @@ export const applicationsApi = {
|
||||
|
||||
// Search API
|
||||
export const searchApi = {
|
||||
search(query) {
|
||||
return api.get('/search', { params: { q: query } })
|
||||
search(query, params = {}) {
|
||||
return api.get('/search', { params: { q: query, ...params } })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,6 +646,9 @@ export const reportsApi = {
|
||||
},
|
||||
assetInventory(params = {}) {
|
||||
return api.get('/reports/asset-inventory', { params })
|
||||
},
|
||||
pcRelationships(params = {}) {
|
||||
return api.get('/reports/pc-relationships', { params })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user