Skip to content

Commit cd53f25

Browse files
Merge pull request #14622 from ARajan1084/guardrail-key-configuration-fix
Fix: 14473: Guardrail view, edit, and delete behavior
2 parents 0fde408 + 626c48b commit cd53f25

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

ui/litellm-dashboard/src/components/organisms/create_key_button.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
857857
className="mt-4"
858858
help={premiumUser ? "Select existing guardrails or enter new ones" : "Premium feature - Upgrade to set guardrails by key"}
859859
>
860-
<Tooltip
861-
title={!premiumUser ? "Setting guardrails by key is a premium feature" : ""}
862-
placement="top"
863-
>
864860
<Select
865861
mode="tags"
866862
style={{ width: '100%' }}
@@ -872,7 +868,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
872868
}
873869
options={guardrailsList.map(name => ({ value: name, label: name }))}
874870
/>
875-
</Tooltip>
876871
</Form.Item>
877872
<Form.Item
878873
label={
@@ -894,10 +889,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
894889
className="mt-4"
895890
help={premiumUser ? "Select existing prompts or enter new ones" : "Premium feature - Upgrade to set prompts by key"}
896891
>
897-
<Tooltip
898-
title={!premiumUser ? "Setting prompts by key is a premium feature" : ""}
899-
placement="top"
900-
>
901892
<Select
902893
mode="tags"
903894
style={{ width: '100%' }}
@@ -909,7 +900,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
909900
}
910901
options={promptsList.map(name => ({ value: name, label: name }))}
911902
/>
912-
</Tooltip>
913903
</Form.Item>
914904
<Form.Item
915905
label={

ui/litellm-dashboard/src/components/templates/key_edit_view.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import EditLoggingSettings from "../team/EditLoggingSettings"
1111
import { extractLoggingSettings, formatMetadataForDisplay } from "../key_info_utils"
1212
import { fetchMCPAccessGroups } from "../networking"
1313
import { mapInternalToDisplayNames, mapDisplayToInternalNames } from "../callback_info_helpers"
14+
import GuardrailSelector from "@/components/guardrails/GuardrailSelector"
1415

1516
interface KeyEditViewProps {
1617
keyData: KeyResponse
@@ -220,20 +221,9 @@ export function KeyEditView({
220221
</Form.Item>
221222

222223
<Form.Item label="Guardrails" name="guardrails">
223-
<Tooltip title={!premiumUser ? "Setting guardrails by key is a premium feature" : ""} placement="top">
224-
<Select
225-
mode="tags"
226-
style={{ width: "100%" }}
227-
disabled={!premiumUser}
228-
placeholder={
229-
!premiumUser
230-
? "Premium feature - Upgrade to set guardrails by key"
231-
: Array.isArray(keyData.metadata?.guardrails) && keyData.metadata.guardrails.length > 0
232-
? `Current: ${keyData.metadata.guardrails.join(", ")}`
233-
: "Select or enter guardrails"
234-
}
235-
/>
236-
</Tooltip>
224+
{ accessToken &&
225+
<GuardrailSelector onChange={(v) => {form.setFieldValue("guardrails", v)}} accessToken={accessToken} />
226+
}
237227
</Form.Item>
238228

239229
<Form.Item label="Prompts" name="prompts">

0 commit comments

Comments
 (0)