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}
|
||||
</>
|
||||
),
|
||||
value: db.space_id || db.param,
|
||||
value: db.param,
|
||||
};
|
||||
}),
|
||||
[dbs],
|
||||
|
@@ -233,7 +233,7 @@ export default function DocPanel(props: IProps) {
|
||||
|
||||
const { run: search, loading: searchLoading } = useRequest(
|
||||
async (id, doc_name: string) => {
|
||||
const [, res] = await apiInterceptors(searchDocumentList(id, { doc_name }));
|
||||
const [, res] = await apiInterceptors(searchDocumentList(space.name, { doc_name }));
|
||||
return res;
|
||||
},
|
||||
{
|
||||
@@ -249,7 +249,7 @@ export default function DocPanel(props: IProps) {
|
||||
const { run: editChunkRun, loading: chunkLoading } = useRequest(
|
||||
async (values: any) => {
|
||||
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_name: values.doc_name,
|
||||
});
|
||||
|
@@ -251,20 +251,26 @@ const Chat: React.FC = () => {
|
||||
}
|
||||
}, [isChatDefault]);
|
||||
|
||||
// if (scene === 'chat_dashboard') {
|
||||
// return (
|
||||
// <div>
|
||||
// <ChatSider
|
||||
// refresh={refreshDialogList}
|
||||
// dialogueList={dialogueList}
|
||||
// listLoading={listLoading}
|
||||
// historyLoading={historyLoading}
|
||||
// order={order}
|
||||
// />
|
||||
// {isContract ? <DbEditor /> : <ChatContainer />}
|
||||
// </div>
|
||||
// );
|
||||
// }
|
||||
const contentRender = () => {
|
||||
if (scene === 'chat_dashboard') {
|
||||
return (isContract ?
|
||||
<DbEditor /> :
|
||||
<ChatContainer />);
|
||||
} else {
|
||||
return (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>
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ChatContentContext.Provider
|
||||
@@ -304,19 +310,7 @@ const Chat: React.FC = () => {
|
||||
order={order}
|
||||
/>
|
||||
<Layout className="bg-transparent">
|
||||
{scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null}
|
||||
{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}
|
||||
{contentRender()}
|
||||
</Layout>
|
||||
</Layout>
|
||||
</Flex>
|
||||
|
Reference in New Issue
Block a user