Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

UI Fixes p2 (#8502)

Krish Dholakia3f0438a59d0c
diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py
index 0f5bc46cc6b..0d875195112 100644
--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py
+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py
@@ -885,6 +885,11 @@ async def delete_user(
where={"user_id": {"in": data.user_ids}}
)
+ ## DELETE ASSOCIATED ORGANIZATION MEMBERSHIPS
+ await prisma_client.db.litellm_organizationmembership.delete_many(
+ where={"user_id": {"in": data.user_ids}}
+ )
+
## DELETE USERS
deleted_users = await prisma_client.db.litellm_usertable.delete_many(
where={"user_id": {"in": data.user_ids}}
diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsx
index 32fd0f2865c..d10c9bda423 100644
--- a/ui/litellm-dashboard/src/components/admins.tsx
+++ b/ui/litellm-dashboard/src/components/admins.tsx
@@ -496,116 +496,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
return (
<div className="w-full m-2 mt-2 p-8">
<Title level={4}>Admin Access </Title>
- <Paragraph>
- {showSSOBanner && (
- <a href="https://docs.litellm.ai/docs/proxy/ui#restrict-ui-access">
- Requires SSO Setup
- </a>
- )}
- <br />
- <b>Proxy Admin: </b> Can create keys, teams, users, add models, etc.{" "}
- <br />
- <b>Proxy Admin Viewer: </b>Can just view spend. They cannot create keys,
- teams or grant users access to new models.{" "}
- </Paragraph>
- <Grid numItems={1} className="gap-2 p-2 w-full">
- <Col numColSpan={1}>
- <Card className="w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]">
- <Table>
- <TableHead>
- <TableRow>
- <TableHeaderCell>Member Name</TableHeaderCell>
- <TableHeaderCell>Role</TableHeaderCell>
- </TableRow>
- </TableHead>
-
- <TableBody>
- {admins
- ? admins.map((member: any, index: number) => (
- <TableRow key={index}>
- <TableCell>
- {member["user_email"]
- ? member["user_email"]
- : member["user_id"]
- ? member["user_id"]
- : null}
- </TableCell>
- <TableCell>
- {" "}
- {possibleUIRoles?.[member?.user_role]?.ui_label ||
- "-"}
- </TableCell>
- <TableCell>
- <Icon
- icon={PencilAltIcon}
- size="sm"
- onClick={() => setIsUpdateModalModalVisible(true)}
- />
- <Modal
- title="Update role"
- visible={isUpdateMemberModalVisible}
- width={800}
- footer={null}
- onOk={handleMemberUpdateOk}
- onCancel={handleMemberUpdateCancel}
- >
- {modifyMemberForm(
- handleMemberUpdate,
- member["user_role"],
- member["user_id"]
- )}
- </Modal>
- </TableCell>
- </TableRow>
- ))
- : null}
- </TableBody>
- </Table>
- </Card>
- </Col>
- <Col numColSpan={1}>
- <div className="flex justify-start">
- <Button
- className="mr-4 mb-5"
- onClick={() => setIsAddAdminModalVisible(true)}
- >
- + Add admin
- </Button>
- <Modal
- title="Add admin"
- visible={isAddAdminModalVisible}
- width={800}
- footer={null}
- onOk={handleAdminOk}
- onCancel={handleAdminCancel}
- >
- {addMemberForm(handleAdminCreate)}
- </Modal>
- <OnboardingModal
- isInvitationLinkModalVisible={isInvitationLinkModalVisible}
- setIsInvitationLinkModalVisible={setIsInvitationLinkModalVisible}
- baseUrl={baseUrl}
- invitationLinkData={invitationLinkData}
- />
- <Button
- className="mb-5"
- onClick={() => setIsAddMemberModalVisible(true)}
- >
- + Add viewer
- </Button>
- <Modal
- title="Add viewer"
- visible={isAddMemberModalVisible}
- width={800}
- footer={null}
- onOk={handleMemberOk}
- onCancel={handleMemberCancel}
- >
- {addMemberForm(handleMemberCreate)}
- </Modal>
- </div>
- </Col>
- </Grid>
+ <Paragraph>Go to &apos;Internal Users&apos; page to add other admins.</Paragraph>
<Grid >
<Card>
<Title level={4}> ✨ Security Settings</Title>
diff --git a/ui/litellm-dashboard/src/components/common_components/user_search_modal.tsx b/ui/litellm-dashboard/src/components/common_components/user_search_modal.tsx
index e31c0384826..e415c04f2b9 100644
--- a/ui/litellm-dashboard/src/components/common_components/user_search_modal.tsx
+++ b/ui/litellm-dashboard/src/components/common_components/user_search_modal.tsx
@@ -163,7 +163,7 @@ const UserSearchModal: React.FC<UserSearchModalProps> = ({
</Form.Item>
<div className="text-right mt-4">
- <Button type="primary" htmlType="submit">
+ <Button type="default" htmlType="submit">
Add Member
</Button>
</div>
diff --git a/ui/litellm-dashboard/src/components/team/edit_membership.tsx b/ui/litellm-dashboard/src/components/team/edit_membership.tsx
index 2e22f2a5d66..3d1696916e9 100644
--- a/ui/litellm-dashboard/src/components/team/edit_membership.tsx
+++ b/ui/litellm-dashboard/src/components/team/edit_membership.tsx
@@ -129,7 +129,7 @@ const TeamMemberModal: React.FC<TeamMemberModalProps> = ({
Cancel
</AntButton>
<AntButton
- type="primary"
+ type="default"
htmlType="submit"
>
{mode === 'add' ? 'Add Member' : 'Save Changes'}