mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fixes for SCIM settings on ui
This commit is contained in:
parent
d3e2949e7c
commit
3971a9e6ff
3 changed files with 15 additions and 4 deletions
|
@ -300,6 +300,7 @@ export default function CreateKeyPage() {
|
||||||
accessToken={accessToken}
|
accessToken={accessToken}
|
||||||
showSSOBanner={showSSOBanner}
|
showSSOBanner={showSSOBanner}
|
||||||
premiumUser={premiumUser}
|
premiumUser={premiumUser}
|
||||||
|
proxySettings={proxySettings}
|
||||||
/>
|
/>
|
||||||
) : page == "api_ref" ? (
|
) : page == "api_ref" ? (
|
||||||
<APIRef proxySettings={proxySettings} />
|
<APIRef proxySettings={proxySettings} />
|
||||||
|
|
|
@ -16,15 +16,23 @@ import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||||
interface SCIMConfigProps {
|
interface SCIMConfigProps {
|
||||||
accessToken: string | null;
|
accessToken: string | null;
|
||||||
userID: string | null;
|
userID: string | null;
|
||||||
baseUrl: string;
|
proxySettings: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCIMConfig: React.FC<SCIMConfigProps> = ({ accessToken, userID, baseUrl }) => {
|
const SCIMConfig: React.FC<SCIMConfigProps> = ({ accessToken, userID, proxySettings }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [isCreatingToken, setIsCreatingToken] = useState(false);
|
const [isCreatingToken, setIsCreatingToken] = useState(false);
|
||||||
const [tokenData, setTokenData] = useState<any>(null);
|
const [tokenData, setTokenData] = useState<any>(null);
|
||||||
|
|
||||||
const scimBaseUrl = `${baseUrl}/scim`;
|
let base_url = "<your_proxy_base_url>";
|
||||||
|
|
||||||
|
if (proxySettings) {
|
||||||
|
if (proxySettings.PROXY_BASE_URL && proxySettings.PROXY_BASE_URL !== undefined) {
|
||||||
|
base_url = proxySettings.PROXY_BASE_URL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const scimBaseUrl = `${base_url}/scim`;
|
||||||
|
|
||||||
const handleCreateSCIMToken = async (values: any) => {
|
const handleCreateSCIMToken = async (values: any) => {
|
||||||
if (!accessToken || !userID) {
|
if (!accessToken || !userID) {
|
||||||
|
|
|
@ -51,6 +51,7 @@ interface AdminPanelProps {
|
||||||
setTeams: React.Dispatch<React.SetStateAction<Team[] | null>>;
|
setTeams: React.Dispatch<React.SetStateAction<Team[] | null>>;
|
||||||
showSSOBanner: boolean;
|
showSSOBanner: boolean;
|
||||||
premiumUser: boolean;
|
premiumUser: boolean;
|
||||||
|
proxySettings?: any;
|
||||||
}
|
}
|
||||||
import { useBaseUrl } from "./constants";
|
import { useBaseUrl } from "./constants";
|
||||||
|
|
||||||
|
@ -73,6 +74,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
|
||||||
accessToken,
|
accessToken,
|
||||||
showSSOBanner,
|
showSSOBanner,
|
||||||
premiumUser,
|
premiumUser,
|
||||||
|
proxySettings,
|
||||||
}) => {
|
}) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [memberForm] = Form.useForm();
|
const [memberForm] = Form.useForm();
|
||||||
|
@ -638,7 +640,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
|
||||||
<SCIMConfig
|
<SCIMConfig
|
||||||
accessToken={accessToken}
|
accessToken={accessToken}
|
||||||
userID={admins && admins.length > 0 ? admins[0].user_id : null}
|
userID={admins && admins.length > 0 ? admins[0].user_id : null}
|
||||||
baseUrl={baseUrl}
|
proxySettings={proxySettings}
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</TabPanels>
|
</TabPanels>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue