mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
UI - Users page - Enable global sorting (allows finding users with highest spend) (#10211)
* fix(view_users.tsx): add time tracking logic to debounce search - prevent new queries from being overwritten by previous ones * fix(internal_user_endpoints.py): add sort functionality to user list endpoint * feat(internal_user_endpoints.py): support sort by on `/user/list` * fix(view_users.tsx): enable global sorting allows finding user with highest spend * feat(view_users.tsx): support filtering by sso user id * test(search_users.spec.ts): add tests to ensure filtering works * test: add more unit testing
This commit is contained in:
parent
92cacb88aa
commit
3fe5c2f677
6 changed files with 287 additions and 17 deletions
|
@ -679,6 +679,9 @@ export const userListCall = async (
|
|||
userEmail: string | null = null,
|
||||
userRole: string | null = null,
|
||||
team: string | null = null,
|
||||
sso_user_id: string | null = null,
|
||||
sortBy: string | null = null,
|
||||
sortOrder: 'asc' | 'desc' | null = null,
|
||||
) => {
|
||||
/**
|
||||
* Get all available teams on proxy
|
||||
|
@ -713,6 +716,18 @@ export const userListCall = async (
|
|||
if (team) {
|
||||
queryParams.append('team', team);
|
||||
}
|
||||
|
||||
if (sso_user_id) {
|
||||
queryParams.append('sso_user_ids', sso_user_id);
|
||||
}
|
||||
|
||||
if (sortBy) {
|
||||
queryParams.append('sort_by', sortBy);
|
||||
}
|
||||
|
||||
if (sortOrder) {
|
||||
queryParams.append('sort_order', sortOrder);
|
||||
}
|
||||
|
||||
const queryString = queryParams.toString();
|
||||
if (queryString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue