forked from phoenix/litellm-mirror
(feat) team add all models available
This commit is contained in:
parent
e8ead49d29
commit
30a4f224ee
1 changed files with 16 additions and 0 deletions
|
@ -87,6 +87,17 @@ const Team: React.FC<TeamProps> = ({
|
|||
setIsDeleteModalOpen(true);
|
||||
};
|
||||
|
||||
const handleModelSelection = (selectedModels: string[]) => {
|
||||
if (selectedModels.includes("all_models")) {
|
||||
// Select all models except "All Models"
|
||||
const allModelsExceptAll = userModels.filter(model => model !== "all");
|
||||
form.setFieldsValue({
|
||||
models: allModelsExceptAll
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const confirmDelete = async () => {
|
||||
if (teamToDelete == null || teams == null || accessToken == null) {
|
||||
return;
|
||||
|
@ -343,7 +354,11 @@ const Team: React.FC<TeamProps> = ({
|
|||
mode="multiple"
|
||||
placeholder="Select models"
|
||||
style={{ width: "100%" }}
|
||||
onChange={(selectedModels) => handleModelSelection(selectedModels)}
|
||||
>
|
||||
<Select2.Option key="all_models" value="all_models">
|
||||
All Models
|
||||
</Select2.Option>
|
||||
{userModels.map((model) => (
|
||||
<Select2.Option key={model} value={model}>
|
||||
{model}
|
||||
|
@ -351,6 +366,7 @@ const Team: React.FC<TeamProps> = ({
|
|||
))}
|
||||
</Select2>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Max Budget (USD)" name="max_budget">
|
||||
<InputNumber step={0.01} precision={2} width={200} />
|
||||
</Form.Item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue