Skip to content

Commit a9587b9

Browse files
authored
feat: update knowledge base file detail view with pagination and metadata display (#233)
* feat: update error handling in RagEtlService and add commons-io dependency * feat: enhance Docker configuration with additional services and profiles * feat: update knowledge base file detail view with pagination and metadata display * feat: enhance knowledge base file detail view with file name display in breadcrumbs * feat: update KnowledgeBaseFileDetail component with improved icon size and color * feat: update KnowledgeBaseFileDetail component with improved icon size and color * feat: update KnowledgeBaseFileDetail component with improved icon size and color
1 parent de31b84 commit a9587b9

File tree

5 files changed

+194
-488
lines changed

5 files changed

+194
-488
lines changed

deployment/docker/datamate/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ services:
281281
- "9001:9001"
282282
- "9000:9000"
283283
volumes:
284-
- minio-volume:/minio_data
285-
command: minio server /minio_data --console-address ":9001"
284+
- minio-volume:/data
285+
command: minio server /data --console-address ":9001"
286286
networks:
287287
- datamate
288288
healthcheck:

frontend/src/components/DetailHeader.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,34 @@ function DetailHeader<T>({
4949
<div className="flex items-start justify-between">
5050
<div className="flex items-start gap-4 flex-1">
5151
<div
52-
className={`w-16 h-16 text-white rounded-lg flex-center shadow-lg ${
52+
className={`w-16 h-16 text-white rounded-lg flex items-center justify-center shadow-lg ${
5353
(data as any)?.iconColor
5454
? ""
5555
: "bg-gradient-to-br from-sky-300 to-blue-500 text-white"
5656
}`}
5757
style={(data as any)?.iconColor ? { backgroundColor: (data as any).iconColor } : undefined}
5858
>
59-
{<div className="w-[2.8rem] h-[2.8rem] text-gray-50">{(data as any)?.icon}</div> || (
59+
{(data as any)?.icon ? (
60+
<div className="w-[2.8rem] h-[2.8rem] text-gray-50 flex items-center justify-center">{(data as any).icon}</div>
61+
) : (
6062
<Database className="w-8 h-8 text-white" />
6163
)}
6264
</div>
6365
<div className="flex-1">
6466
<div className="flex items-center gap-3 mb-2">
65-
<h1 className="text-lg font-bold text-gray-900">{data?.name}</h1>
66-
{data?.status && (
67-
<Tag color={data.status?.color}>
67+
<h1 className="text-lg font-bold text-gray-900">{(data as any)?.name}</h1>
68+
{(data as any)?.status && (
69+
<Tag color={(data as any).status?.color}>
6870
<div className="flex items-center gap-2 text-xs">
69-
{data.status?.icon && <span>{data.status?.icon}</span>}
70-
<span>{data.status?.label}</span>
71+
{(data as any).status?.icon && <span>{(data as any).status?.icon}</span>}
72+
<span>{(data as any).status?.label}</span>
7173
</div>
7274
</Tag>
7375
)}
7476
</div>
75-
{data?.tags && (
77+
{(data as any)?.tags && (
7678
<div className="flex flex-wrap mb-2">
77-
{data?.tags?.map((tag) => (
79+
{(data as any)?.tags?.map((tag: any) => (
7880
<Tag key={tag.id} className="mr-1">
7981
{tag.name}
8082
</Tag>
@@ -89,9 +91,9 @@ function DetailHeader<T>({
8991
)}
9092
</div>
9193
)}
92-
<p className="text-gray-700 mb-4">{data?.description}</p>
94+
<p className="text-gray-700 mb-4">{(data as any)?.description}</p>
9395
<div className="flex items-center gap-6 text-sm">
94-
{statistics.map((stat) => (
96+
{statistics.map((stat: any) => (
9597
<div key={stat.key} className="flex items-center gap-1">
9698
{stat.icon}
9799
<span>{stat.value}</span>
@@ -101,7 +103,7 @@ function DetailHeader<T>({
101103
</div>
102104
</div>
103105
<div className="flex items-center gap-2">
104-
{operations.map((op) => {
106+
{operations.map((op: any) => {
105107
if (op.isDropdown) {
106108
return (
107109
<ActionDropdown

frontend/src/pages/KnowledgeBase/Detail/KnowledgeBaseDetail.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ const KnowledgeBaseDetailPage: React.FC = () => {
170170
width: 200,
171171
ellipsis: true,
172172
fixed: "left" as const,
173+
render: (_: unknown, file: KBFile) => (
174+
<a onClick={() => navigate(`/data/knowledge-base/file-detail/${file.id}?knowledgeBaseId=${knowledgeBase?.id || ''}&fileName=${encodeURIComponent(file.name || file.fileName || '')}`)}>
175+
{file.name}
176+
</a>
177+
)
173178
},
174179
{
175180
title: "状态",

0 commit comments

Comments
 (0)