Merge branch 'feat/dev-0.6' of https://github.com/eosphoros-ai/DB-GPT into feat/dev-0.6

This commit is contained in:
yhjun1026
2024-08-13 19:08:01 +08:00
3 changed files with 190 additions and 175 deletions

View File

@@ -155,7 +155,7 @@ const ChatSider: React.FC<{
}> = ({ dialogueList = [], refresh, historyLoading, listLoading, order }) => { }> = ({ dialogueList = [], refresh, historyLoading, listLoading, order }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { mode } = useContext(ChatContext); const { mode } = useContext(ChatContext);
const [collapsed, setCollapsed] = useState<boolean>(false); const [collapsed, setCollapsed] = useState<boolean>(true);
// 展开或收起列表按钮样式 // 展开或收起列表按钮样式
const triggerStyle: React.CSSProperties = useMemo(() => { const triggerStyle: React.CSSProperties = useMemo(() => {
@@ -194,6 +194,7 @@ const ChatSider: React.FC<{
theme={mode} theme={mode}
width={280} width={280}
collapsible={true} collapsible={true}
collapsed={collapsed}
collapsedWidth={0} collapsedWidth={0}
trigger={collapsed ? <CaretRightOutlined className="text-base" /> : <CaretLeftOutlined className="text-base" />} trigger={collapsed ? <CaretRightOutlined className="text-base" /> : <CaretLeftOutlined className="text-base" />}
zeroWidthTriggerStyle={triggerStyle} zeroWidthTriggerStyle={triggerStyle}

View File

@@ -474,7 +474,8 @@ function DbEditor() {
return ( return (
<div className="flex flex-col w-full h-full overflow-hidden"> <div className="flex flex-col w-full h-full overflow-hidden">
<Header /> <Header />
<div className="relative flex flex-1 overflow-hidden"> <div className="relative flex flex-1 p-4 pt-0 overflow-hidden">
<div className="relative flex overflow-hidden mr-4">
<div <div
className={classNames('h-full relative transition-[width] overflow-hidden', { className={classNames('h-full relative transition-[width] overflow-hidden', {
'w-0': isMenuExpand, 'w-0': isMenuExpand,
@@ -654,6 +655,7 @@ function DbEditor() {
)} )}
</div> </div>
</div> </div>
</div>
); );
} }

View File

@@ -251,9 +251,20 @@ const Chat: React.FC = () => {
} }
}, [isChatDefault]); }, [isChatDefault]);
if (scene === 'chat_dashboard') { // if (scene === 'chat_dashboard') {
return <>{isContract ? <DbEditor /> : <ChatContainer />}</>; // return (
} // <div>
// <ChatSider
// refresh={refreshDialogList}
// dialogueList={dialogueList}
// listLoading={listLoading}
// historyLoading={historyLoading}
// order={order}
// />
// {isContract ? <DbEditor /> : <ChatContainer />}
// </div>
// );
// }
return ( return (
<ChatContentContext.Provider <ChatContentContext.Provider
@@ -293,7 +304,8 @@ const Chat: React.FC = () => {
order={order} order={order}
/> />
<Layout className="bg-transparent"> <Layout className="bg-transparent">
{isChatDefault ? ( {scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null}
{scene !== 'chat_dashboard' ? (isChatDefault ? (
<Content> <Content>
<ChatDefault /> <ChatDefault />
</Content> </Content>
@@ -304,7 +316,7 @@ const Chat: React.FC = () => {
<ChatInputPanel ctrl={ctrl} /> <ChatInputPanel ctrl={ctrl} />
</Content> </Content>
</Spin> </Spin>
)} )) : null}
</Layout> </Layout>
</Layout> </Layout>
</Flex> </Flex>