mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
scim settings
This commit is contained in:
parent
3971a9e6ff
commit
61190daf7c
1 changed files with 15 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
Title,
|
Title,
|
||||||
|
@ -23,16 +23,22 @@ const SCIMConfig: React.FC<SCIMConfigProps> = ({ accessToken, userID, proxySetti
|
||||||
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 [baseUrl, setBaseUrl] = useState("<your_proxy_base_url>");
|
||||||
|
|
||||||
let base_url = "<your_proxy_base_url>";
|
useEffect(() => {
|
||||||
|
let url = "<your_proxy_base_url>";
|
||||||
if (proxySettings) {
|
|
||||||
if (proxySettings.PROXY_BASE_URL && proxySettings.PROXY_BASE_URL !== undefined) {
|
if (proxySettings && proxySettings.PROXY_BASE_URL && proxySettings.PROXY_BASE_URL !== undefined) {
|
||||||
base_url = proxySettings.PROXY_BASE_URL;
|
url = proxySettings.PROXY_BASE_URL;
|
||||||
|
} else if (typeof window !== 'undefined') {
|
||||||
|
// Use the current origin as the base URL if no proxy URL is set
|
||||||
|
url = window.location.origin;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
setBaseUrl(url);
|
||||||
|
}, [proxySettings]);
|
||||||
|
|
||||||
const scimBaseUrl = `${base_url}/scim`;
|
const scimBaseUrl = `${baseUrl}/scim/v2`;
|
||||||
|
|
||||||
const handleCreateSCIMToken = async (values: any) => {
|
const handleCreateSCIMToken = async (values: any) => {
|
||||||
if (!accessToken || !userID) {
|
if (!accessToken || !userID) {
|
||||||
|
@ -70,7 +76,7 @@ const SCIMConfig: React.FC<SCIMConfigProps> = ({ accessToken, userID, proxySetti
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<div className="mt-6">
|
<div className="mt-6">
|
||||||
<Title className="text-lg">SCIM Base URL</Title>
|
<Title className="text-lg">SCIM Tenant URL (Base URL)</Title>
|
||||||
<div className="flex items-center mt-2 mb-6">
|
<div className="flex items-center mt-2 mb-6">
|
||||||
<TextInput
|
<TextInput
|
||||||
value={scimBaseUrl}
|
value={scimBaseUrl}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue