mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Add global filtering to Users tab (#10195)
* style(internal_user_endpoints.py): add response model to `/user/list` endpoint
make sure we maintain consistent response spec
* fix(key_management_endpoints.py): return 'created_at' and 'updated_at' on `/key/generate`
Show 'created_at' on UI when key created
* test(test_keys.py): add e2e test to ensure created at is always returned
* fix(view_users.tsx): support global search by user email
allows easier search
* test(search_users.spec.ts): add e2e test ensure user search works on admin ui
* fix(view_users.tsx): support filtering user by role and user id
More powerful filtering on internal users table
* fix(view_users.tsx): allow filtering users by team
* style(view_users.tsx): cleanup ui to show filters in consistent style
* refactor(view_users.tsx): cleanup to just use 1 variable for the data
* fix(view_users.tsx): cleanup use effect hooks
* fix(internal_user_endpoints.py): fix check to pass testing
* test: update tests
* test: update tests
* Revert "test: update tests"
This reverts commit 6553eeb232
.
* fix(view_userts.tsx): add back in 'previous' and 'next' tabs for pagination
This commit is contained in:
parent
b2955a2bdd
commit
66680c421d
12 changed files with 556 additions and 88 deletions
|
@ -676,6 +676,9 @@ export const userListCall = async (
|
|||
userIDs: string[] | null = null,
|
||||
page: number | null = null,
|
||||
page_size: number | null = null,
|
||||
userEmail: string | null = null,
|
||||
userRole: string | null = null,
|
||||
team: string | null = null,
|
||||
) => {
|
||||
/**
|
||||
* Get all available teams on proxy
|
||||
|
@ -698,6 +701,18 @@ export const userListCall = async (
|
|||
if (page_size) {
|
||||
queryParams.append('page_size', page_size.toString());
|
||||
}
|
||||
|
||||
if (userEmail) {
|
||||
queryParams.append('user_email', userEmail);
|
||||
}
|
||||
|
||||
if (userRole) {
|
||||
queryParams.append('role', userRole);
|
||||
}
|
||||
|
||||
if (team) {
|
||||
queryParams.append('team', team);
|
||||
}
|
||||
|
||||
const queryString = queryParams.toString();
|
||||
if (queryString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue