ui - support all-models alias

This commit is contained in:
Ishaan Jaff 2024-04-02 15:27:50 -07:00
parent 73ef4780f7
commit dfc020ca5f
3 changed files with 8 additions and 11 deletions

View file

@ -142,9 +142,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
placeholder="Select models"
style={{ width: "100%" }}
>
<Option key="all-models" value="all-models">
All Models
</Option>
{team && team.models ? (
team.models.map((model: string) => (
<Option key={model} value={model}>

View file

@ -123,6 +123,9 @@ const Team: React.FC<TeamProps> = ({
placeholder="Select models"
style={{ width: "100%" }}
>
<Select2.Option key="all-models" value="all-models">
All Models
</Select2.Option>
{userModels && userModels.map((model) => (
<Select2.Option key={model} value={model}>
{model}
@ -360,8 +363,8 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
{Array.isArray(team.models) ? (
<div style={{ display: "flex", flexDirection: "column" }}>
{team.models.length === 0 ? (
<Badge size={"xs"} className="mb-1" color="purple">
<Text>All Models</Text>
<Badge size={"xs"} className="mb-1" color="blue">
<Text>all-models</Text>
</Badge>
) : (
team.models.map((model: string, index: number) => (

View file

@ -147,10 +147,7 @@ const ViewKeyTable: React.FC<ViewKeyTableProps> = ({
mode="multiple"
placeholder="Select models"
style={{ width: "100%" }}
>
<Option key="all_models" value="all_models">
All Models
</Option>
>
{selectedTeam && selectedTeam.models ? (
selectedTeam.models.map((model: string) => (
<Option key={model} value={model}>
@ -420,8 +417,8 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
))
) : (
// If selected team is None or selected team's models are empty, show all models
<Badge size={"xs"} className="mb-1" color="purple">
<Text>All Models</Text>
<Badge size={"xs"} className="mb-1" color="blue">
<Text>all-models</Text>
</Badge>
)}
</>