mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 13:10:29 +00:00
Merge remote-tracking branch 'origin/feat/dev-0.6' into feat/dev-0.6
This commit is contained in:
@@ -75,7 +75,7 @@ const Resource: React.FC<{
|
|||||||
{db.param}
|
{db.param}
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
value: db.space_id || db.param,
|
value: db.param,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
[dbs],
|
[dbs],
|
||||||
|
@@ -233,7 +233,7 @@ export default function DocPanel(props: IProps) {
|
|||||||
|
|
||||||
const { run: search, loading: searchLoading } = useRequest(
|
const { run: search, loading: searchLoading } = useRequest(
|
||||||
async (id, doc_name: string) => {
|
async (id, doc_name: string) => {
|
||||||
const [, res] = await apiInterceptors(searchDocumentList(id, { doc_name }));
|
const [, res] = await apiInterceptors(searchDocumentList(space.name, { doc_name }));
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -249,7 +249,7 @@ export default function DocPanel(props: IProps) {
|
|||||||
const { run: editChunkRun, loading: chunkLoading } = useRequest(
|
const { run: editChunkRun, loading: chunkLoading } = useRequest(
|
||||||
async (values: any) => {
|
async (values: any) => {
|
||||||
return await editChunk(props.space.name, {
|
return await editChunk(props.space.name, {
|
||||||
questions: values.questions.map((item: any) => item.question),
|
questions: values.questions?.map((item: any) => item.question),
|
||||||
doc_id: curDoc?.id || '',
|
doc_id: curDoc?.id || '',
|
||||||
doc_name: values.doc_name,
|
doc_name: values.doc_name,
|
||||||
});
|
});
|
||||||
|
@@ -250,21 +250,27 @@ const Chat: React.FC = () => {
|
|||||||
setHistory([]);
|
setHistory([]);
|
||||||
}
|
}
|
||||||
}, [isChatDefault]);
|
}, [isChatDefault]);
|
||||||
|
|
||||||
// if (scene === 'chat_dashboard') {
|
const contentRender = () => {
|
||||||
// return (
|
if (scene === 'chat_dashboard') {
|
||||||
// <div>
|
return (isContract ?
|
||||||
// <ChatSider
|
<DbEditor /> :
|
||||||
// refresh={refreshDialogList}
|
<ChatContainer />);
|
||||||
// dialogueList={dialogueList}
|
} else {
|
||||||
// listLoading={listLoading}
|
return (isChatDefault ? (
|
||||||
// historyLoading={historyLoading}
|
<Content>
|
||||||
// order={order}
|
<ChatDefault />
|
||||||
// />
|
</Content>
|
||||||
// {isContract ? <DbEditor /> : <ChatContainer />}
|
) : (
|
||||||
// </div>
|
<Spin spinning={historyLoading} className="w-full h-full m-auto">
|
||||||
// );
|
<Content className="flex flex-col h-screen">
|
||||||
// }
|
<ChatContentContainer ref={scrollRef} />
|
||||||
|
<ChatInputPanel ctrl={ctrl} />
|
||||||
|
</Content>
|
||||||
|
</Spin>
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChatContentContext.Provider
|
<ChatContentContext.Provider
|
||||||
@@ -304,19 +310,7 @@ const Chat: React.FC = () => {
|
|||||||
order={order}
|
order={order}
|
||||||
/>
|
/>
|
||||||
<Layout className="bg-transparent">
|
<Layout className="bg-transparent">
|
||||||
{scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null}
|
{contentRender()}
|
||||||
{scene !== 'chat_dashboard' ? (isChatDefault ? (
|
|
||||||
<Content>
|
|
||||||
<ChatDefault />
|
|
||||||
</Content>
|
|
||||||
) : (
|
|
||||||
<Spin spinning={historyLoading} className="w-full h-full m-auto">
|
|
||||||
<Content className="flex flex-col h-screen">
|
|
||||||
<ChatContentContainer ref={scrollRef} />
|
|
||||||
<ChatInputPanel ctrl={ctrl} />
|
|
||||||
</Content>
|
|
||||||
</Spin>
|
|
||||||
)) : null}
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Reference in New Issue
Block a user