diff --git a/ui/litellm-dashboard/src/components/user_dashboard.tsx b/ui/litellm-dashboard/src/components/user_dashboard.tsx index 3e644796612..600da27d839 100644 --- a/ui/litellm-dashboard/src/components/user_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/user_dashboard.tsx @@ -219,6 +219,7 @@ const UserDashboard: React.FC = ({ diff --git a/ui/litellm-dashboard/src/components/view_key_table.tsx b/ui/litellm-dashboard/src/components/view_key_table.tsx index 93226d352b0..4269bfc0243 100644 --- a/ui/litellm-dashboard/src/components/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/view_key_table.tsx @@ -29,6 +29,7 @@ import ViewKeySpendReport from "./view_key_spend_report"; interface ViewKeyTableProps { userID: string; accessToken: string; + selectedTeam: any | null; data: any[] | null; setData: React.Dispatch>; } @@ -52,6 +53,7 @@ interface ItemData { const ViewKeyTable: React.FC = ({ userID, accessToken, + selectedTeam, data, setData, }) => { @@ -177,6 +179,11 @@ const ViewKeyTable: React.FC = ({ if (item.team_id === "litellm-dashboard") { return null; } + if (selectedTeam) { + if (item.team_id != selectedTeam.team_id) { + return null; + } + } return ( @@ -229,19 +236,31 @@ const ViewKeyTable: React.FC = ({ {Array.isArray(item.models) ? (
{item.models.length === 0 ? ( - - All Models - - ) : ( - item.models.map((model: string, index: number) => ( - - {model.length > 30 ? `${model.slice(0, 30)}...` : model} + <> + {selectedTeam && selectedTeam.models && selectedTeam.models.length > 0 ? ( + selectedTeam.models.map((model: string, index: number) => ( + + {model.length > 30 ? `${model.slice(0, 30)}...` : model} + + )) + ) : ( + // If selected team is None or selected team's models are empty, show all models + + All Models - )) - )} + )} + + ) : ( + item.models.map((model: string, index: number) => ( + + {model.length > 30 ? `${model.slice(0, 30)}...` : model} + + )) + )}
) : null}
+ TPM: {item.tpm_limit ? item.tpm_limit : "Unlimited"}{" "}