mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-14 06:26:18 +00:00
Merge remote-tracking branch 'origin/new-page-framework' into llm_framework
This commit is contained in:
commit
4a5b25b4f1
@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { ProFormInstance } from '@ant-design/pro-components';
|
import type { ProFormInstance } from '@ant-design/pro-components';
|
||||||
import React, { useState, useRef } from 'react'
|
import React, { useState, useRef, useEffect } from 'react'
|
||||||
import {
|
import {
|
||||||
ProCard,
|
ProCard,
|
||||||
ProForm,
|
ProForm,
|
||||||
@ -22,6 +22,22 @@ const Index = () => {
|
|||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [knowledgeSpaceName, setKnowledgeSpaceName] = useState<string>('');
|
const [knowledgeSpaceName, setKnowledgeSpaceName] = useState<string>('');
|
||||||
const [webPageUrl, setWebPageUrl] = useState<string>('');
|
const [webPageUrl, setWebPageUrl] = useState<string>('');
|
||||||
|
useEffect(() => {
|
||||||
|
async function fetchData() {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fetchData();
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="page-header p-4">
|
<div className="page-header p-4">
|
||||||
@ -38,6 +54,9 @@ const Index = () => {
|
|||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text: string) => {
|
||||||
|
return <a href='javascript:;'>{text}</a>
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Provider',
|
title: 'Provider',
|
||||||
@ -151,6 +170,7 @@ const Index = () => {
|
|||||||
if (data.success) {
|
if (data.success) {
|
||||||
props.onSubmit?.();
|
props.onSubmit?.();
|
||||||
message.success('success');
|
message.success('success');
|
||||||
|
setIsAddKnowledgeSpaceModalShow(false);
|
||||||
} else {
|
} else {
|
||||||
message.error(data.err_msg || 'failed');
|
message.error(data.err_msg || 'failed');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user