+
+
+
-
diff --git a/ui/litellm-dashboard/src/components/create_key_button.tsx b/ui/litellm-dashboard/src/components/create_key_button.tsx
index a468c25827..0ec06348e8 100644
--- a/ui/litellm-dashboard/src/components/create_key_button.tsx
+++ b/ui/litellm-dashboard/src/components/create_key_button.tsx
@@ -339,7 +339,7 @@ const CreateKey: React.FC
= ({
+ Create New Key
= ({
>
{/* Section 1: Key Ownership */}
-
1. Key Ownership
+
Key Ownership
@@ -444,7 +444,7 @@ const CreateKey: React.FC = ({
{/* Section 2: Key Details */}
-
2. Key Details
+
Key Details
@@ -503,7 +503,7 @@ const CreateKey: React.FC = ({
- 3. Optional Settings
+ Optional Settings
{
+ return async (searchText: string): Promise> => {
+ if (!organizations || !searchText.trim()) {
+ return [];
+ }
+
+ // Find organizations that match the search text by alias
+ const matchingOrgs: Array<{ label: string; value: string }> = [];
+
+ organizations.forEach(org => {
+ if (
+ org.organization_alias &&
+ org.organization_alias.toLowerCase().includes(searchText.toLowerCase())
+ ) {
+ matchingOrgs.push({
+ label: `${org.organization_alias} (${org.organization_id})`,
+ value: org.organization_id || ""
+ });
+ }
+ });
+
+ return matchingOrgs;
+ };
+ };
\ No newline at end of file
diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/team_search_fn.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/team_search_fn.tsx
new file mode 100644
index 0000000000..b9522546ed
--- /dev/null
+++ b/ui/litellm-dashboard/src/components/key_team_helpers/team_search_fn.tsx
@@ -0,0 +1,22 @@
+import { Team } from "./key_list";
+
+export const createTeamSearchFunction = (teams: Team[] | null) => {
+ return async (searchText: string): Promise> => {
+ // Return empty array if teams is null or searchText is empty
+ if (!teams || !searchText.trim()) {
+ return [];
+ }
+
+ // Filter teams where team_alias contains the search text (case insensitive)
+ const filteredTeams = teams.filter(team =>
+ team.team_alias.toLowerCase().includes(searchText.toLowerCase())
+ );
+
+ // Map filtered teams to the required format
+ return filteredTeams.map(team => ({
+ label: `${team.team_alias} (${team.team_id.substring(0, 8)}...)`,
+ value: team.team_id
+ }));
+ };
+ };
+
\ No newline at end of file