feat: server-side filter, village filter, and sortable columns on users page

This commit is contained in:
2026-05-22 11:17:38 +08:00
parent ed9f59f404
commit 603a0a04b7
2 changed files with 115 additions and 48 deletions

View File

@@ -9,8 +9,15 @@ export const API_URLS = {
`${DESA_PLUS_PROXY}/api/monitoring/grid-villages?id=${id}`,
graphLogVillages: (id: string, time: string) =>
`${DESA_PLUS_PROXY}/api/monitoring/graph-log-villages?id=${id}&time=${time}`,
getUsers: (page: number, search: string) =>
`${DESA_PLUS_PROXY}/api/monitoring/user?page=${page}&search=${encodeURIComponent(search)}`,
getUsers: (page: number, search: string, isActive?: string, idUserRole?: string, idVillage?: string, orderBy?: string, orderDir?: string) => {
const params = new URLSearchParams({ page: String(page), search })
if (isActive !== undefined) params.set('isActive', isActive)
if (idUserRole) params.set('idUserRole', idUserRole)
if (idVillage) params.set('idVillage', idVillage)
if (orderBy) params.set('orderBy', orderBy)
if (orderDir) params.set('orderDir', orderDir)
return `${DESA_PLUS_PROXY}/api/monitoring/user?${params}`
},
getLogsAllVillages: (page: number, search: string) =>
`${DESA_PLUS_PROXY}/api/monitoring/log-all-villages?page=${page}&search=${encodeURIComponent(search)}`,
getGridOverview: () => `${DESA_PLUS_PROXY}/api/monitoring/grid-overview`,