forked from phoenix/litellm-mirror
fix - admins tab show human friendly role
This commit is contained in:
parent
efa37bd461
commit
764f42a6d5
1 changed files with 6 additions and 1 deletions
|
@ -42,6 +42,7 @@ import {
|
||||||
userGetAllUsersCall,
|
userGetAllUsersCall,
|
||||||
User,
|
User,
|
||||||
setCallbacksCall,
|
setCallbacksCall,
|
||||||
|
getPossibleUserRoles,
|
||||||
} from "./networking";
|
} from "./networking";
|
||||||
|
|
||||||
const AdminPanel: React.FC<AdminPanelProps> = ({
|
const AdminPanel: React.FC<AdminPanelProps> = ({
|
||||||
|
@ -60,6 +61,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
|
||||||
const [isUpdateMemberModalVisible, setIsUpdateModalModalVisible] = useState(false);
|
const [isUpdateMemberModalVisible, setIsUpdateModalModalVisible] = useState(false);
|
||||||
const [isAddSSOModalVisible, setIsAddSSOModalVisible] = useState(false);
|
const [isAddSSOModalVisible, setIsAddSSOModalVisible] = useState(false);
|
||||||
const [isInstructionsModalVisible, setIsInstructionsModalVisible] = useState(false);
|
const [isInstructionsModalVisible, setIsInstructionsModalVisible] = useState(false);
|
||||||
|
const [possibleUIRoles, setPossibleUIRoles] = useState<null | Record<string, Record<string, string>>>(null);
|
||||||
|
|
||||||
let nonSssoUrl;
|
let nonSssoUrl;
|
||||||
try {
|
try {
|
||||||
|
@ -133,6 +135,9 @@ const handleInstructionsCancel = () => {
|
||||||
console.log(`proxy admins: ${proxyAdmins}`);
|
console.log(`proxy admins: ${proxyAdmins}`);
|
||||||
console.log(`combinedList: ${combinedList}`);
|
console.log(`combinedList: ${combinedList}`);
|
||||||
setAdmins(combinedList);
|
setAdmins(combinedList);
|
||||||
|
|
||||||
|
const availableUserRoles = await getPossibleUserRoles(accessToken);
|
||||||
|
setPossibleUIRoles(availableUserRoles);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -373,7 +378,7 @@ const handleInstructionsCancel = () => {
|
||||||
? member["user_id"]
|
? member["user_id"]
|
||||||
: null}
|
: null}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{member["user_role"]}</TableCell>
|
<TableCell> {possibleUIRoles?.[member?.user_role]?.ui_label || "-"}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Icon icon={PencilAltIcon} size="sm" onClick={() => setIsUpdateModalModalVisible(true)}/>
|
<Icon icon={PencilAltIcon} size="sm" onClick={() => setIsUpdateModalModalVisible(true)}/>
|
||||||
<Modal
|
<Modal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue