From cfb250903dac0dfa49c5851d301339ef2a59e3ac Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 10 Apr 2024 12:07:21 -0700 Subject: [PATCH] ui - setup sso on admin ui --- .../src/components/admins.tsx | 147 ++++++++++++------ 1 file changed, 101 insertions(+), 46 deletions(-) diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsx index 90319d232b1..926df9b87cb 100644 --- a/ui/litellm-dashboard/src/components/admins.tsx +++ b/ui/litellm-dashboard/src/components/admins.tsx @@ -57,6 +57,33 @@ const AdminPanel: React.FC = ({ const [isAddMemberModalVisible, setIsAddMemberModalVisible] = useState(false); const [isAddAdminModalVisible, setIsAddAdminModalVisible] = useState(false); const [isUpdateMemberModalVisible, setIsUpdateModalModalVisible] = useState(false); + const [isAddSSOModalVisible, setIsAddSSOModalVisible] = useState(false); + const [isInstructionsModalVisible, setIsInstructionsModalVisible] = useState(false); + +const handleAddSSOOk = () => { + setIsAddSSOModalVisible(false); + form.resetFields(); +}; + +const handleAddSSOCancel = () => { + setIsAddSSOModalVisible(false); + form.resetFields(); +}; + +const handleShowInstructions = (formValues: Record) => { + setIsAddSSOModalVisible(false); + setIsInstructionsModalVisible(true); + // Optionally, you can call handleSSOUpdate here with the formValues + // handleSSOUpdate(formValues); +}; + +const handleInstructionsOk = () => { + setIsInstructionsModalVisible(false); +}; + +const handleInstructionsCancel = () => { + setIsInstructionsModalVisible(false); +}; const roles = ["proxy_admin", "proxy_admin_viewer"] @@ -392,55 +419,83 @@ const AdminPanel: React.FC = ({ - Add SSO - -
- <> - - - - + Add SSO +
+ + - - - + + <> + + + - - - - -
- Save + + + + + + + + +
+ Save +
+ + + + +

Follow these steps to complete the SSO setup:

+ + 1. DO NOT Exit this TAB + + + 2. Open a new tab, visit your proxy base url + + + 3. Confirm your SSO is configured correctly and you can login on the new Tab + + + 4. If Step 3 is successful, you can close this tab + +
+ Done
- - - - - +
+
+
); };