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