diff --git a/datacenter/app/datastores/page.tsx b/datacenter/app/datastores/page.tsx index 05033bca5..bba7f9c23 100644 --- a/datacenter/app/datastores/page.tsx +++ b/datacenter/app/datastores/page.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' import { InboxOutlined } from '@ant-design/icons' -import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined'; +import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined' import type { UploadProps } from 'antd' import { message, Upload, Popover } from 'antd' import { @@ -90,13 +90,16 @@ const Index = () => { } useEffect(() => { async function fetchData() { - const res = await fetch(`${process.env.API_BASE_URL}/knowledge/space/list`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({}) - }) + const res = await fetch( + `${process.env.API_BASE_URL}/knowledge/space/list`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({}) + } + ) const data = await res.json() if (data.success) { setKnowledgeSpaceList(data.data) @@ -128,74 +131,94 @@ const Index = () => { + New Knowledge Space -
- {knowledgeSpaceList.length ? ( - - - - - - - - - - - {knowledgeSpaceList.map((row: any) => ( - - - - - - - ))} - -
NameVectorOwnerDescription
- { - - router.push(`/datastores/documents?name=${row.name}`) - } - > - {row.name} - - } - - - {row.vector_type} - - - - {row.owner} - - - - {row.desc.length > 10 - ? `${row.desc.slice(0, 10)}...` - : row.desc} - -
- ) : ( - <> - )} -
+ + + {knowledgeSpaceList.map((item: any, index: number) => ( + { + router.push(`/datastores/documents?name=${item.name}`); + }} + > + {item.name} + + + {item.vector_type} + Vector + + + {item.owner} + Owner + + + {item.owner} + Docs + + + + ))} + + + { color: activeStep === index ? '#814DDE' : '' }} > - {index < activeStep ? : `${index + 1}.`} + {index < activeStep ? ( + + ) : ( + `${index + 1}.` + )} {`${item}`} ))}