mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-29 10:13:20 +08:00
add knowledge base tab
This commit is contained in:
parent
51691ee008
commit
7a32e8ba10
29
frontend/src/app/knowledge/(desktop)/index.tsx
Normal file
29
frontend/src/app/knowledge/(desktop)/index.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { FC, memo } from 'react';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import ResponsiveIndex from '@/components/ResponsiveIndex';
|
||||
|
||||
import PageTitle from '../features/PageTitle';
|
||||
import ChatHeader from './features/ChatHeader';
|
||||
import Conversation from './features/Conversation';
|
||||
import SideBar from './features/SideBar';
|
||||
import Layout from './layout.desktop';
|
||||
|
||||
const Mobile: FC = dynamic(() => import('../(mobile)'), { ssr: false }) as FC;
|
||||
|
||||
const DesktopPage = memo(() => (
|
||||
<ResponsiveIndex Mobile={Mobile}>
|
||||
<Layout>
|
||||
<PageTitle />
|
||||
<ChatHeader />
|
||||
<Flexbox flex={1} height={'calc(100% - 64px)'} horizontal>
|
||||
<Conversation />
|
||||
<SideBar />
|
||||
</Flexbox>
|
||||
</Layout>
|
||||
</ResponsiveIndex>
|
||||
));
|
||||
export default DesktopPage;
|
||||
23
frontend/src/app/knowledge/(desktop)/layout.desktop.tsx
Normal file
23
frontend/src/app/knowledge/(desktop)/layout.desktop.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { PropsWithChildren, memo } from 'react';
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
import AppLayoutDesktop from '@/layout/AppLayout.desktop';
|
||||
import { SidebarTabKey } from '@/store/global/initialState';
|
||||
|
||||
|
||||
export default memo(({ children }: PropsWithChildren) => {
|
||||
return (
|
||||
<AppLayoutDesktop sidebarKey={SidebarTabKey.Chat}>
|
||||
<Flexbox
|
||||
flex={1}
|
||||
height={'100%'}
|
||||
id={'lobe-conversion-container'}
|
||||
style={{ position: 'relative' }}
|
||||
>
|
||||
{children}
|
||||
</Flexbox>
|
||||
</AppLayoutDesktop>
|
||||
);
|
||||
});
|
||||
9
frontend/src/app/knowledge/page.tsx
Normal file
9
frontend/src/app/knowledge/page.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
const Page = () => {
|
||||
// const mobile = isMobileDevice();
|
||||
|
||||
// const Page = mobile ? MobilePage : DesktopPage;
|
||||
|
||||
return <div>321</div>;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
@ -1,5 +1,5 @@
|
||||
import { ActionIcon } from '@lobehub/ui';
|
||||
import { Compass, MessageSquare } from 'lucide-react';
|
||||
import { Compass, Library, MessageSquare } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@ -43,6 +43,15 @@ const TopActions = memo<TopActionProps>(({ tab }) => {
|
||||
title={t('tab.market')}
|
||||
/>
|
||||
</Link>
|
||||
<Link aria-label={'知识库'} href={'/knowledge'}>
|
||||
<ActionIcon
|
||||
active={tab === SidebarTabKey.Knowledge}
|
||||
icon={Library}
|
||||
placement={'right'}
|
||||
size="large"
|
||||
title={'知识库'}
|
||||
/>
|
||||
</Link>
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
@ -2,6 +2,7 @@ import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.share
|
||||
|
||||
export enum SidebarTabKey {
|
||||
Chat = 'chat',
|
||||
Knowledge = 'knowledge',
|
||||
Market = 'market',
|
||||
Setting = 'settings',
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user