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);
|
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 () => {
|
const confirmDelete = async () => {
|
||||||
if (teamToDelete == null || teams == null || accessToken == null) {
|
if (teamToDelete == null || teams == null || accessToken == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -343,7 +354,11 @@ const Team: React.FC<TeamProps> = ({
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="Select models"
|
placeholder="Select models"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
|
onChange={(selectedModels) => handleModelSelection(selectedModels)}
|
||||||
>
|
>
|
||||||
|
<Select2.Option key="all_models" value="all_models">
|
||||||
|
All Models
|
||||||
|
</Select2.Option>
|
||||||
{userModels.map((model) => (
|
{userModels.map((model) => (
|
||||||
<Select2.Option key={model} value={model}>
|
<Select2.Option key={model} value={model}>
|
||||||
{model}
|
{model}
|
||||||
|
@ -351,6 +366,7 @@ const Team: React.FC<TeamProps> = ({
|
||||||
))}
|
))}
|
||||||
</Select2>
|
</Select2>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item label="Max Budget (USD)" name="max_budget">
|
<Form.Item label="Max Budget (USD)" name="max_budget">
|
||||||
<InputNumber step={0.01} precision={2} width={200} />
|
<InputNumber step={0.01} precision={2} width={200} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue