forked from phoenix/litellm-mirror
show all models in red on ui
This commit is contained in:
parent
3245d8cdce
commit
6e3ec361ae
3 changed files with 29 additions and 19 deletions
|
@ -142,6 +142,9 @@ const CreateKey: React.FC<CreateKeyProps> = ({
|
||||||
placeholder="Select models"
|
placeholder="Select models"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
|
<Option key="all-team-models" value="all-team-models">
|
||||||
|
All Team Models
|
||||||
|
</Option>
|
||||||
{team && team.models ? (
|
{team && team.models ? (
|
||||||
team.models.map((model: string) => (
|
team.models.map((model: string) => (
|
||||||
<Option key={model} value={model}>
|
<Option key={model} value={model}>
|
||||||
|
|
|
@ -116,16 +116,13 @@ const Team: React.FC<TeamProps> = ({
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Models" name="models">
|
<Form.Item label="Models" name="models">
|
||||||
<Select2.Option key="all-proxy-models" value="all-proxy-models">
|
<Select2.Option key="all-proxy-models" value="all-proxy-models">
|
||||||
All Models on Proxy
|
All Proxy Models
|
||||||
</Select2.Option>
|
</Select2.Option>
|
||||||
<Select2
|
<Select2
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="Select models"
|
placeholder="Select models"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
<Select2.Option key="all-proxy-models" value="all-proxy-models">
|
|
||||||
All Models on Proxy
|
|
||||||
</Select2.Option>
|
|
||||||
{userModels && userModels.map((model) => (
|
{userModels && userModels.map((model) => (
|
||||||
<Select2.Option key={model} value={model}>
|
<Select2.Option key={model} value={model}>
|
||||||
{model}
|
{model}
|
||||||
|
@ -359,23 +356,30 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
<TableCell style={{ maxWidth: "4px", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
<TableCell style={{ maxWidth: "4px", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
||||||
{team["max_budget"] ? team["max_budget"] : "No limit"}
|
{team["max_budget"] ? team["max_budget"] : "No limit"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={{ maxWidth: "8-x", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
<TableCell style={{ maxWidth: "8-x", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
||||||
{Array.isArray(team.models) ? (
|
{Array.isArray(team.models) ? (
|
||||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||||
{team.models.length === 0 ? (
|
{team.models.length === 0 ? (
|
||||||
<Badge size={"xs"} className="mb-1" color="blue">
|
<Badge size={"xs"} className="mb-1" color="red">
|
||||||
<Text>all-proxy-models</Text>
|
<Text>All Proxy Models</Text>
|
||||||
</Badge>
|
</Badge>
|
||||||
) : (
|
) : (
|
||||||
team.models.map((model: string, index: number) => (
|
team.models.map((model: string, index: number) => (
|
||||||
|
model === "all-proxy-models" ? (
|
||||||
|
<Badge key={index} size={"xs"} className="mb-1" color="red">
|
||||||
|
<Text>All Proxy Models</Text>
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
<Badge key={index} size={"xs"} className="mb-1" color="blue">
|
<Badge key={index} size={"xs"} className="mb-1" color="blue">
|
||||||
<Text>{model.length > 30 ? `${model.slice(0, 30)}...` : model}</Text>
|
<Text>{model.length > 30 ? `${model.slice(0, 30)}...` : model}</Text>
|
||||||
</Badge>
|
</Badge>
|
||||||
))
|
)
|
||||||
)}
|
))
|
||||||
</div>
|
)}
|
||||||
) : null}
|
</div>
|
||||||
|
) : null}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell style={{ maxWidth: "4px", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
<TableCell style={{ maxWidth: "4px", whiteSpace: "pre-wrap", overflow: "hidden" }}>
|
||||||
<Text>
|
<Text>
|
||||||
TPM:{" "}
|
TPM:{" "}
|
||||||
|
@ -484,7 +488,7 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
<Select2.Option key="all-proxy-models" value="all-proxy-models">
|
<Select2.Option key="all-proxy-models" value="all-proxy-models">
|
||||||
All Models on Proxy
|
All Proxy Models
|
||||||
</Select2.Option>
|
</Select2.Option>
|
||||||
{userModels.map((model) => (
|
{userModels.map((model) => (
|
||||||
<Select2.Option key={model} value={model}>
|
<Select2.Option key={model} value={model}>
|
||||||
|
|
|
@ -148,6 +148,9 @@ const ViewKeyTable: React.FC<ViewKeyTableProps> = ({
|
||||||
placeholder="Select models"
|
placeholder="Select models"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
|
<Option key="all-team-models" value="all-team-models">
|
||||||
|
All Team Models
|
||||||
|
</Option>
|
||||||
{selectedTeam && selectedTeam.models ? (
|
{selectedTeam && selectedTeam.models ? (
|
||||||
selectedTeam.models.map((model: string) => (
|
selectedTeam.models.map((model: string) => (
|
||||||
<Option key={model} value={model}>
|
<Option key={model} value={model}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue