mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-09 10:22:01 +00:00
Merge pull request #19694 from BerriAI/litellm_ci_fix_yj_02
[Infra] CI/CD - Fixing UI Build
This commit is contained in:
@@ -279,7 +279,7 @@ const PoliciesPanel: React.FC<PoliciesPanelProps> = ({
|
||||
description={
|
||||
<div>
|
||||
<p className="mb-3">
|
||||
Policy attachments control where your policies apply. Policies don't do anything until you attach them to specific teams, keys, models, or globally.
|
||||
Policy attachments control where your policies apply. Policies don't do anything until you attach them to specific teams, keys, models, or globally.
|
||||
</p>
|
||||
<p className="mb-2 font-semibold">Attachment Scopes:</p>
|
||||
<ul className="list-disc list-inside mb-3 space-y-1 ml-2">
|
||||
|
||||
@@ -96,6 +96,8 @@ export interface TeamData {
|
||||
model_aliases: Record<string, string>;
|
||||
} | null;
|
||||
created_at: string;
|
||||
guardrails?: string[];
|
||||
policies?: string[];
|
||||
object_permission?: {
|
||||
object_permission_id: string;
|
||||
mcp_servers: string[];
|
||||
@@ -270,7 +272,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
||||
// Fetch resolved guardrails for all policies
|
||||
useEffect(() => {
|
||||
const fetchPolicyGuardrails = async () => {
|
||||
if (!accessToken || !info?.policies || info.policies.length === 0) {
|
||||
if (!accessToken || !teamData?.team_info?.policies || teamData.team_info.policies.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -279,7 +281,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
||||
|
||||
try {
|
||||
await Promise.all(
|
||||
info.policies.map(async (policyName: string) => {
|
||||
teamData.team_info.policies.map(async (policyName: string) => {
|
||||
try {
|
||||
const policyInfo = await getPolicyInfoWithGuardrails(accessToken, policyName);
|
||||
guardrailsMap[policyName] = policyInfo.resolved_guardrails || [];
|
||||
@@ -298,7 +300,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
||||
};
|
||||
|
||||
fetchPolicyGuardrails();
|
||||
}, [accessToken, info?.policies]);
|
||||
}, [accessToken, teamData?.team_info?.policies]);
|
||||
|
||||
const handleMemberCreate = async (values: any) => {
|
||||
try {
|
||||
@@ -462,6 +464,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
||||
logging: values.logging_settings || [],
|
||||
...(secretManagerSettings !== undefined ? { secret_manager_settings: secretManagerSettings } : {}),
|
||||
},
|
||||
policies: values.policies || [],
|
||||
organization_id: values.organization_id,
|
||||
};
|
||||
|
||||
@@ -757,6 +760,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
||||
team_member_budget: info.team_member_budget_table?.max_budget,
|
||||
team_member_budget_duration: info.team_member_budget_table?.budget_duration,
|
||||
guardrails: info.metadata?.guardrails || [],
|
||||
policies: info.policies || [],
|
||||
disable_global_guardrails: info.metadata?.disable_global_guardrails || false,
|
||||
metadata: info.metadata
|
||||
? JSON.stringify(
|
||||
|
||||
@@ -73,7 +73,8 @@ export default function KeyInfoView({
|
||||
// Fetch resolved guardrails for all policies
|
||||
useEffect(() => {
|
||||
const fetchPolicyGuardrails = async () => {
|
||||
if (!accessToken || !currentKeyData?.metadata?.policies || currentKeyData.metadata.policies.length === 0) {
|
||||
const policies = currentKeyData?.metadata?.policies;
|
||||
if (!accessToken || !policies || !Array.isArray(policies) || policies.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ export default function KeyInfoView({
|
||||
|
||||
try {
|
||||
await Promise.all(
|
||||
currentKeyData.metadata.policies.map(async (policyName: string) => {
|
||||
policies.map(async (policyName: string) => {
|
||||
try {
|
||||
const policyInfo = await getPolicyInfoWithGuardrails(accessToken, policyName);
|
||||
guardrailsMap[policyName] = policyInfo.resolved_guardrails || [];
|
||||
@@ -521,9 +522,9 @@ export default function KeyInfoView({
|
||||
|
||||
<Card>
|
||||
<Text className="font-medium mb-3">Guardrails</Text>
|
||||
{currentKeyData.guardrails && currentKeyData.guardrails.length > 0 ? (
|
||||
{Array.isArray(currentKeyData.metadata?.guardrails) && currentKeyData.metadata.guardrails.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{currentKeyData.guardrails.map((guardrail, index) => (
|
||||
{currentKeyData.metadata.guardrails.map((guardrail: string, index: number) => (
|
||||
<Badge key={index} color="blue">
|
||||
{guardrail}
|
||||
</Badge>
|
||||
@@ -532,16 +533,17 @@ export default function KeyInfoView({
|
||||
) : (
|
||||
<Text className="text-gray-500">No guardrails configured</Text>
|
||||
)}
|
||||
{currentKeyData.metadata?.disable_global_guardrails && (
|
||||
<div className="mt-3 pt-3 border-t border-gray-200">
|
||||
<Badge color="yellow">Global Guardrails Disabled</Badge>
|
||||
</div>
|
||||
)}
|
||||
{typeof currentKeyData.metadata?.disable_global_guardrails === "boolean" &&
|
||||
currentKeyData.metadata.disable_global_guardrails === true && (
|
||||
<div className="mt-3 pt-3 border-t border-gray-200">
|
||||
<Badge color="yellow">Global Guardrails Disabled</Badge>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<Text className="font-medium mb-3">Policies</Text>
|
||||
{currentKeyData.metadata?.policies && currentKeyData.metadata.policies.length > 0 ? (
|
||||
{Array.isArray(currentKeyData.metadata?.policies) && currentKeyData.metadata.policies.length > 0 ? (
|
||||
<div className="space-y-4">
|
||||
{currentKeyData.metadata.policies.map((policy: string, index: number) => (
|
||||
<div key={index} className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user