diff --git a/datacenter/app/datastores/page.tsx b/datacenter/app/datastores/page.tsx index f4afb82cb..a90ea27ef 100644 --- a/datacenter/app/datastores/page.tsx +++ b/datacenter/app/datastores/page.tsx @@ -13,23 +13,48 @@ import { ProFormTextArea, StepsForm } from '@ant-design/pro-components' -import { Button, Modal, message } from 'antd' +import { Button, Modal, Table, message } from 'antd' const Index = () => { const formRef = useRef(); + const [knowledgeSpaceList, setKnowledgeSpaceList] = useState([]); const [isAddKnowledgeSpaceModalShow, setIsAddKnowledgeSpaceModalShow] = useState(false); const [knowledgeSpaceName, setKnowledgeSpaceName] = useState(''); - const [webUrlName, setWebUrlName] = useState(''); const [webPageUrl, setWebPageUrl] = useState(''); return ( <> -
-
Knowledge Spaces
+
+
Knowledge Spaces
+
+ + { if (data.success) { props.onSubmit?.(); message.success('success'); + const res = await fetch('http://localhost:8000/knowledge/space/list', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({}), + }); + const data = await res.json(); + if (data.success) { + setKnowledgeSpaceList(data.data); + } } else { message.error(data.err_msg || 'failed'); } @@ -107,8 +143,8 @@ const Index = () => { 'Content-Type': 'application/json', }, body: JSON.stringify({ - doc_name: webUrlName, - doc_type: webPageUrl + doc_name: webPageUrl, + doc_type: 'URL' }), }); const data = await res.json(); @@ -160,14 +196,6 @@ const Index = () => { name="time" title="Setup the Datasource" > - setWebUrlName(e.target.value)} - /> {