diff --git a/datacenter/app/chat/page.tsx b/datacenter/app/chat/page.tsx index de94b13a9..529b56efa 100644 --- a/datacenter/app/chat/page.tsx +++ b/datacenter/app/chat/page.tsx @@ -5,6 +5,7 @@ import useAgentChat from '@/hooks/useAgentChat'; import ChatBoxComp from '@/components/chatBoxTemp'; import { useDialogueContext } from '@/app/context/dialogue'; import { useSearchParams } from 'next/navigation'; + const AgentPage = () => { const searchParams = useSearchParams(); const { refreshDialogList } = useDialogueContext(); @@ -20,7 +21,7 @@ const AgentPage = () => { const { data: paramsList } = useRequest(async () => await sendPostRequest(`/v1/chat/mode/params/list?chat_mode=${scene}`), { ready: !!scene, - refreshDeps: [scene] + refreshDeps: [id, scene] }); const { history, handleChatSubmit } = useAgentChat({ diff --git a/datacenter/app/datastores/page.tsx b/datacenter/app/datastores/page.tsx index 05033bca5..d6f2e5469 100644 --- a/datacenter/app/datastores/page.tsx +++ b/datacenter/app/datastores/page.tsx @@ -3,7 +3,9 @@ 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 AddBoxOutlinedIcon from '@mui/icons-material/AddBoxOutlined'; +import ContentPasteSearchOutlinedIcon from '@mui/icons-material/ContentPasteSearchOutlined'; import type { UploadProps } from 'antd' import { message, Upload, Popover } from 'antd' import { @@ -90,13 +92,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) @@ -105,97 +110,135 @@ const Index = () => { fetchData() }, []) return ( - <> - - + + - Knowledge Spaces - - - -
- {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} - -
- ) : ( - <> - )} -
+ onClick={() => setIsAddKnowledgeSpaceModalShow(true)} + >Space + {knowledgeSpaceList.map((item: any, index: number) => ( + { + router.push(`/datastores/documents?name=${item.name}`); + }} + > + {item.name} + + + {item.vector_type} + Vector + + + {item.owner} + Owner + + + {item.docs || 0} + Docs + + + + ))} + + + { color: activeStep === index ? '#814DDE' : '' }} > - {index < activeStep ? : `${index + 1}.`} + {index < activeStep ? ( + + ) : ( + `${index + 1}.` + )} {`${item}`} ))} @@ -533,7 +580,7 @@ const Index = () => { )} - + ) } diff --git a/datacenter/app/page.tsx b/datacenter/app/page.tsx index b23ebde43..f66af26c4 100644 --- a/datacenter/app/page.tsx +++ b/datacenter/app/page.tsx @@ -61,6 +61,9 @@ export default function Home() { size="md" variant="solid" className='text-base rounded-none ' + style={{ + boxShadow: '0px 8px 10px 0px rgb(31 31 31 / 50%)' + }} onClick={async () => { const res = await sendPostRequest('/v1/chat/dialogue/new', { chat_mode: scene['chat_scene'] diff --git a/datacenter/components/leftSider.tsx b/datacenter/components/leftSider.tsx index 489f79cf6..b2b552463 100644 --- a/datacenter/components/leftSider.tsx +++ b/datacenter/components/leftSider.tsx @@ -130,7 +130,7 @@ const LeftSider = () => { - + {each?.user_name || each?.user_input || 'undefined'}