mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
EditMembership: add Allowed Models multi-select field
This commit is contained in:
parent
19b105b00d
commit
77ca095412
1 changed files with 13 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ interface ModalConfig {
|
|||
additionalFields?: Array<{
|
||||
name: string;
|
||||
label: string | React.ReactNode;
|
||||
type: "input" | "select" | "numerical";
|
||||
type: "input" | "select" | "numerical" | "multi-select";
|
||||
options?: Array<{ label: string; value: string }>;
|
||||
rules?: any[];
|
||||
step?: number;
|
||||
|
|
@ -65,6 +65,8 @@ const MemberModal = <T extends BaseMember>({
|
|||
max_budget_in_team: (initialData as any).max_budget_in_team || null,
|
||||
tpm_limit: (initialData as any).tpm_limit || null,
|
||||
rpm_limit: (initialData as any).rpm_limit || null,
|
||||
// Keep array values for multi-select fields
|
||||
allowed_models: (initialData as any).allowed_models || [],
|
||||
};
|
||||
console.log("Setting form values:", formValues);
|
||||
form.setFieldsValue(formValues);
|
||||
|
|
@ -115,7 +117,7 @@ const MemberModal = <T extends BaseMember>({
|
|||
const renderField = (field: {
|
||||
name: string;
|
||||
label: string | React.ReactNode;
|
||||
type: "input" | "select" | "numerical";
|
||||
type: "input" | "select" | "numerical" | "multi-select";
|
||||
options?: Array<{ label: string; value: string }>;
|
||||
rules?: any[];
|
||||
step?: number;
|
||||
|
|
@ -144,6 +146,15 @@ const MemberModal = <T extends BaseMember>({
|
|||
))}
|
||||
</Select>
|
||||
);
|
||||
case "multi-select":
|
||||
return (
|
||||
<Select
|
||||
mode="multiple"
|
||||
placeholder={field.placeholder || "Select options"}
|
||||
options={field.options}
|
||||
allowClear
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue