From 801069590f34b7c2deee18587a1c6c29fd41aadf Mon Sep 17 00:00:00 2001 From: kielbasa-elp Date: Wed, 18 Sep 2024 16:38:02 +0200 Subject: [PATCH] display more details at Knowledge Base cards --- .../list/KnowledgeBaseCollectionList.tsx | 58 +++++++-- .../pipelines/list/PipelinesListItem.tsx | 113 +++++------------- apps/web-remix/app/components/ui/card.tsx | 72 +++++++++++ 3 files changed, 149 insertions(+), 94 deletions(-) diff --git a/apps/web-remix/app/components/pages/knowledgeBase/list/KnowledgeBaseCollectionList.tsx b/apps/web-remix/app/components/pages/knowledgeBase/list/KnowledgeBaseCollectionList.tsx index c6ed819ee..9cb56dcfc 100644 --- a/apps/web-remix/app/components/pages/knowledgeBase/list/KnowledgeBaseCollectionList.tsx +++ b/apps/web-remix/app/components/pages/knowledgeBase/list/KnowledgeBaseCollectionList.tsx @@ -9,7 +9,9 @@ import { confirm } from '~/components/modal/confirm'; import { Card, CardContent, - CardDescription, + CardContentColumnTitle, + CardContentColumnValue, + CardContentColumnWrapper, CardHeader, CardTitle, } from '~/components/ui/card'; @@ -52,7 +54,7 @@ export const KnowledgeBaseCollectionList: React.FC< return ( @@ -118,14 +120,50 @@ export const KnowledgeBaseCollectionListItem: React.FC< - -
- - Chunk size:{data.chunk_size} - - - Chunk overlap:{data.chunk_overlap} - + +
+ + Model + + {data.embeddings.model} + + + + + Endpoint + + {data.embeddings.endpoint} + + + + + Api type + + {data.embeddings.api_type} + + + + + Secret name + + {data.embeddings.secret_name} + + + + + Chunk size + {data.chunk_size} + + + + Chunk overlap + + {data.chunk_overlap} + +
diff --git a/apps/web-remix/app/components/pages/pipelines/list/PipelinesListItem.tsx b/apps/web-remix/app/components/pages/pipelines/list/PipelinesListItem.tsx index 0b024b6d5..1c24e537a 100644 --- a/apps/web-remix/app/components/pages/pipelines/list/PipelinesListItem.tsx +++ b/apps/web-remix/app/components/pages/pipelines/list/PipelinesListItem.tsx @@ -20,7 +20,16 @@ import { resolveBlockTypeIconPath } from '~/components/pages/pipelines/blockType import type { BadgeProps } from '~/components/ui/badge'; import { Badge } from '~/components/ui/badge'; import { Button } from '~/components/ui/button'; -import { Card, CardContent, CardHeader, CardTitle } from '~/components/ui/card'; +import { + Card, + CardContent, + CardContentBooleanValue, + CardContentColumnTitle, + CardContentColumnValue, + CardContentColumnWrapper, + CardHeader, + CardTitle, +} from '~/components/ui/card'; import { DropdownMenu, DropdownMenuContent, @@ -139,9 +148,9 @@ export const PipelineListItemContent = ({ return (
- - Logs - + + Logs + {pipeline.logs_enabled ? ( <> Enabled @@ -151,40 +160,38 @@ export const PipelineListItemContent = ({ Disabled )} - - + + - - Budget limit - + + Budget limit + {pipeline.budget_limit ? ( MonetaryValue.format(pipeline.budget_limit) ) : ( None )} - - + + - - Runs - - {pipeline.runs_count} - - + + Runs + {pipeline.runs_count} + - - Blocks + + Blocks {pipeline.config.blocks.length > 0 ? ( ) : ( - + None - + )}
- +
); @@ -226,68 +233,6 @@ function DuplicateForm({ pipeline }: DuplicateFormProps) { ); } -function PipelinesItemColumnWrapper({ - children, - className, - ...rest -}: React.HTMLAttributes) { - return ( -
- {children} -
- ); -} - -function PipelinesItemColumnTitle({ - children, - className, - ...rest -}: React.HTMLAttributes) { - return ( -

- {children} -

- ); -} - -function PipelinesItemColumnValue({ - children, - className, - ...rest -}: React.HTMLAttributes) { - return ( -

- {children} -

- ); -} - -function PipelinesItemColumnBooleanValue({ - children, - className, - value, - ...rest -}: React.HTMLAttributes & { value: boolean }) { - return ( - - {children} - - ); -} - function PipelineItemInterfaceBadge({ children, className, diff --git a/apps/web-remix/app/components/ui/card.tsx b/apps/web-remix/app/components/ui/card.tsx index 9e5546c67..1a0a88b96 100644 --- a/apps/web-remix/app/components/ui/card.tsx +++ b/apps/web-remix/app/components/ui/card.tsx @@ -76,6 +76,74 @@ const CardFooter = React.forwardRef< )); CardFooter.displayName = 'CardFooter'; +function CardContentColumnWrapper({ + children, + className, + ...rest +}: React.HTMLAttributes) { + return ( +
+ {children} +
+ ); +} + +function CardContentColumnTitle({ + children, + className, + ...rest +}: React.HTMLAttributes) { + return ( +

+ {children} +

+ ); +} + +function CardContentColumnValue({ + children, + className, + ...rest +}: React.HTMLAttributes) { + return ( +

+ {children} +

+ ); +} + +function CardContentBooleanValue({ + children, + className, + value, + ...rest +}: React.HTMLAttributes & { value: boolean }) { + return ( + + {children} + + ); +} + export { Card, CardHeader, @@ -83,4 +151,8 @@ export { CardTitle, CardDescription, CardContent, + CardContentColumnTitle, + CardContentBooleanValue, + CardContentColumnValue, + CardContentColumnWrapper, };