Skip to content

Commit

Permalink
ui(frontend): show placeholder for default value
Browse files Browse the repository at this point in the history
  • Loading branch information
634750802 committed Aug 8, 2024
1 parent fb81244 commit 1a21528
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/app/src/components/form/biz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const LLMSelect = forwardRef<any, Omit<FormSelectProps, 'config'>>((props
return (
<FormSelect
{...props}
placeholder="Default LLM"
config={{
options: llms?.items ?? [],
loading: isLoading,
Expand All @@ -31,6 +32,7 @@ export const RerankerSelect = forwardRef<any, Omit<FormSelectProps, 'config'>>((
return (
<FormSelect
{...props}
placeholder="Default Reranker Model"
config={{
options: rerankers?.items ?? [],
loading: isLoading,
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/src/components/llm/LlmInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export function LlmInfo ({ reverse = false, id }: { reverse?: boolean, id: numbe
const { llm, isLoading } = useLlm(id);

if (isLoading) {
return <Loader2Icon className='size-4 animate-spin repeat-infinite'/>
return <Loader2Icon className="size-4 animate-spin repeat-infinite" />;
}

if (!llm) {
return <span className='text-muted-foreground'>--</span>;
return <Badge variant='outline' className="text-muted-foreground">Default LLM</Badge>;
}

return (
<span className={cn('flex gap-1 items-center', reverse && 'flex-row-reverse')}>
<Badge variant="secondary"><span className='font-bold'>{llm.provider}</span>:<span className='opacity-50'>{llm.model}</span></Badge>
<Badge variant="secondary"><span className="font-bold">{llm.provider}</span>:<span className="opacity-50">{llm.model}</span></Badge>
<Link className={badgeVariants()} href={`/llms/${llm.id}`}>{llm.name}</Link>
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/reranker/RerankerInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function RerankerInfo ({ reverse = false, id }: { reverse?: boolean, id:
}

if (!reranker) {
return <span className="text-muted-foreground">--</span>;
return <Badge variant='outline' className="text-muted-foreground">Default Reranker Model</Badge>;
}

return (
Expand Down

0 comments on commit 1a21528

Please sign in to comment.