mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
feat(ui): add "Your Usage" view for admin users on usage page
Admins were forced to use the global usage view with no way to scope it to their own activity without manually searching for themselves in the user filter dropdown. Adds a new "Your Usage" option (admin-only) to the usage view selector. When selected, it locks the data to the admin's own user_id and hides the "Filter by user" dropdown.
This commit is contained in:
parent
3d2b8fed32
commit
1989572d80
1 changed files with 8 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from "@ant-design/icons";
|
||||
import { Badge, Select } from "antd";
|
||||
import React from "react";
|
||||
export type UsageOption = "global" | "organization" | "team" | "customer" | "tag" | "agent" | "user" | "user-agent-activity";
|
||||
export type UsageOption = "global" | "my-usage" | "organization" | "team" | "customer" | "tag" | "agent" | "user" | "user-agent-activity";
|
||||
export interface UsageViewSelectProps {
|
||||
value: UsageOption;
|
||||
onChange: (value: UsageOption) => void;
|
||||
|
|
@ -43,6 +43,13 @@ const OPTIONS: OptionConfig[] = [
|
|||
descriptionForNonAdmin: "View your usage",
|
||||
icon: <GlobalOutlined style={{ fontSize: "16px" }} />,
|
||||
},
|
||||
{
|
||||
value: "my-usage",
|
||||
label: "Your Usage",
|
||||
description: "View your own usage",
|
||||
icon: <UserOutlined style={{ fontSize: "16px" }} />,
|
||||
adminOnly: true,
|
||||
},
|
||||
{
|
||||
value: "organization",
|
||||
label: "Organization Usage",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue