mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-17 08:37:59 +00:00
fix: ui & hide history list (#5510)
* fix: hidden history list * fix: ui
This commit is contained in:
@@ -54,8 +54,8 @@ const ChatSetting = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<ChatSliderMobileDrawer
|
<ChatSliderMobileDrawer
|
||||||
showHeader
|
showList={false}
|
||||||
showFooter
|
showMenu={false}
|
||||||
banner={chatSettings?.wideLogoUrl}
|
banner={chatSettings?.wideLogoUrl}
|
||||||
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
||||||
/>
|
/>
|
||||||
|
@@ -42,7 +42,7 @@ const ListItem = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid
|
<Grid
|
||||||
py={4}
|
py={[0, 4]}
|
||||||
gridTemplateColumns={[
|
gridTemplateColumns={[
|
||||||
'1fr',
|
'1fr',
|
||||||
'repeat(2,1fr)',
|
'repeat(2,1fr)',
|
||||||
|
@@ -50,22 +50,37 @@ const MyApps = () => {
|
|||||||
const tabs = ['all' as const, AppTypeEnum.simple, AppTypeEnum.workflow, AppTypeEnum.plugin];
|
const tabs = ['all' as const, AppTypeEnum.simple, AppTypeEnum.workflow, AppTypeEnum.plugin];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDirection={'column'} h={'100%'} pt={['46px', 0]}>
|
<Flex flexDirection={'column'} h={'100%'}>
|
||||||
<NextHead title={chatSettings?.homeTabTitle || 'FastGPT'} icon="/icon/logo.svg" />
|
<NextHead title={chatSettings?.homeTabTitle || 'FastGPT'} icon="/icon/logo.svg" />
|
||||||
|
|
||||||
{!isPc && (
|
{!isPc && (
|
||||||
<Flex h="46px" w="100vw" top="0" position="absolute" borderBottom="sm" color="myGray.900">
|
<Flex
|
||||||
|
py={4}
|
||||||
|
color="myGray.900"
|
||||||
|
gap={2}
|
||||||
|
alignItems={'center'}
|
||||||
|
pr={2}
|
||||||
|
justifyContent={'space-between'}
|
||||||
|
>
|
||||||
<MyIcon
|
<MyIcon
|
||||||
ml={3}
|
ml={3}
|
||||||
w="20px"
|
w="20px"
|
||||||
color="myGray.900"
|
color="myGray.500"
|
||||||
name="core/chat/sidebar/menu"
|
name="core/chat/sidebar/menu"
|
||||||
onClick={onOpenSlider}
|
onClick={onOpenSlider}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Box w="70%">
|
||||||
|
<SearchInput
|
||||||
|
onChange={(e) => setSearchKey(e.target.value)}
|
||||||
|
placeholder={t('app:search_app')}
|
||||||
|
maxLength={30}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<ChatSliderMobileDrawer
|
<ChatSliderMobileDrawer
|
||||||
showHeader
|
showList={false}
|
||||||
showFooter
|
showMenu={false}
|
||||||
banner={chatSettings?.wideLogoUrl}
|
banner={chatSettings?.wideLogoUrl}
|
||||||
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
||||||
/>
|
/>
|
||||||
@@ -89,6 +104,7 @@ const MyApps = () => {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Flex gap={5} flex={'1 0 0'} h={0}>
|
<Flex gap={5} flex={'1 0 0'} h={0}>
|
||||||
<Flex
|
<Flex
|
||||||
px={[3, 6]}
|
px={[3, 6]}
|
||||||
@@ -98,7 +114,7 @@ const MyApps = () => {
|
|||||||
overflowY={'auto'}
|
overflowY={'auto'}
|
||||||
overflowX={'hidden'}
|
overflowX={'hidden'}
|
||||||
>
|
>
|
||||||
<Flex pt={paths.length > 0 ? 3 : [4, 6]} alignItems={'center'} gap={3}>
|
<Flex pt={paths.length > 0 ? 3 : [0, 6]} alignItems={'center'} gap={3}>
|
||||||
{isPc && (
|
{isPc && (
|
||||||
<Tabs variant="unstyled" onChange={(index) => setAppType(tabs[index])}>
|
<Tabs variant="unstyled" onChange={(index) => setAppType(tabs[index])}>
|
||||||
<TabList gap={5}>
|
<TabList gap={5}>
|
||||||
@@ -128,19 +144,6 @@ const MyApps = () => {
|
|||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
{!isPc && (
|
|
||||||
<Box mt={2}>
|
|
||||||
{
|
|
||||||
<SearchInput
|
|
||||||
maxW={['auto', '250px']}
|
|
||||||
onChange={(e) => setSearchKey(e.target.value)}
|
|
||||||
placeholder={t('app:search_app')}
|
|
||||||
maxLength={30}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<MyBox flex={'1 0 0'} isLoading={myApps.length === 0 && isFetchingApps}>
|
<MyBox flex={'1 0 0'} isLoading={myApps.length === 0 && isFetchingApps}>
|
||||||
<List appType={appType} />
|
<List appType={appType} />
|
||||||
</MyBox>
|
</MyBox>
|
||||||
|
@@ -130,8 +130,6 @@ const AppChatWindow = ({ myApps }: Props) => {
|
|||||||
</SideBar>
|
</SideBar>
|
||||||
) : (
|
) : (
|
||||||
<ChatSliderMobileDrawer
|
<ChatSliderMobileDrawer
|
||||||
showHeader
|
|
||||||
showFooter
|
|
||||||
banner={chatSettings?.wideLogoUrl}
|
banner={chatSettings?.wideLogoUrl}
|
||||||
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
||||||
/>
|
/>
|
||||||
|
@@ -363,8 +363,6 @@ const HomeChatWindow = ({ myApps }: Props) => {
|
|||||||
</SideBar>
|
</SideBar>
|
||||||
) : (
|
) : (
|
||||||
<ChatSliderMobileDrawer
|
<ChatSliderMobileDrawer
|
||||||
showHeader
|
|
||||||
showFooter
|
|
||||||
banner={chatSettings?.wideLogoUrl}
|
banner={chatSettings?.wideLogoUrl}
|
||||||
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
||||||
/>
|
/>
|
||||||
|
@@ -21,7 +21,7 @@ const ChatSliderFooter = () => {
|
|||||||
const isSettingPane = pane === ChatSidebarPaneEnum.SETTING;
|
const isSettingPane = pane === ChatSidebarPaneEnum.SETTING;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexShrink={0} gap={2} alignItems="center" justifyContent="space-between" p={2}>
|
<Flex flexShrink={0} gap={2} alignItems="center" justifyContent="space-between" p={2} mt="auto">
|
||||||
<UserAvatarPopover isCollapsed={false} placement="top-end">
|
<UserAvatarPopover isCollapsed={false} placement="top-end">
|
||||||
<Flex alignItems="center" gap={2} borderRadius="50%" p={2}>
|
<Flex alignItems="center" gap={2} borderRadius="50%" p={2}>
|
||||||
<Avatar src={userInfo?.avatar} w={8} h={8} borderRadius="50%" bg="myGray.200" />
|
<Avatar src={userInfo?.avatar} w={8} h={8} borderRadius="50%" bg="myGray.200" />
|
||||||
|
@@ -54,7 +54,7 @@ const ChatSliderHeader = ({ title, banner }: Props) => {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Flex align={'center'} justify={'flex-start'} p={2}>
|
<Flex align={'center'} justify={'flex-start'} p={2}>
|
||||||
<Image src={banner || DEFAULT_LOGO_BANNER_URL} alt="banner" w="70%" />
|
<Image src={banner || DEFAULT_LOGO_BANNER_URL} alt="banner" w="60%" />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<MyDivider h="0.5px" bg="myGray.100" my={2} mx={2} w="calc(100% - 16px)" />
|
<MyDivider h="0.5px" bg="myGray.100" my={2} mx={2} w="calc(100% - 16px)" />
|
||||||
@@ -115,8 +115,6 @@ const ChatSliderHeader = ({ title, banner }: Props) => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</GridItem>
|
</GridItem>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<MyDivider h="0.5px" bg="myGray.100" my={2} mx={2} w="calc(100% - 16px)" />
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -7,6 +7,7 @@ import ChatSliderList from '@/pageComponents/chat/slider/ChatSliderList';
|
|||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { ChatContext } from '@/web/core/chat/context/chatContext';
|
import { ChatContext } from '@/web/core/chat/context/chatContext';
|
||||||
import ChatSliderFooter from '@/pageComponents/chat/slider/ChatSliderFooter';
|
import ChatSliderFooter from '@/pageComponents/chat/slider/ChatSliderFooter';
|
||||||
|
import MyDivider from '@fastgpt/web/components/common/MyDivider';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
title?: string;
|
title?: string;
|
||||||
@@ -14,14 +15,18 @@ type Props = {
|
|||||||
menuConfirmButtonText?: string;
|
menuConfirmButtonText?: string;
|
||||||
showHeader?: boolean;
|
showHeader?: boolean;
|
||||||
showFooter?: boolean;
|
showFooter?: boolean;
|
||||||
|
showList?: boolean;
|
||||||
|
showMenu?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ChatSliderMobileDrawer = ({
|
const ChatSliderMobileDrawer = ({
|
||||||
title,
|
title,
|
||||||
banner,
|
banner,
|
||||||
menuConfirmButtonText,
|
menuConfirmButtonText,
|
||||||
showHeader = false,
|
showHeader = true,
|
||||||
showFooter = false
|
showFooter = true,
|
||||||
|
showList = true,
|
||||||
|
showMenu = true
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
@@ -50,9 +55,10 @@ const ChatSliderMobileDrawer = ({
|
|||||||
>
|
>
|
||||||
{showHeader && <ChatSliderHeader title={title} banner={banner} />}
|
{showHeader && <ChatSliderHeader title={title} banner={banner} />}
|
||||||
|
|
||||||
<ChatSliderMenu menuConfirmButtonText={menuConfirmButtonText} />
|
{showMenu && <MyDivider h="0.5px" bg="myGray.100" my={2} mx={2} w="calc(100% - 16px)" />}
|
||||||
|
{showMenu && <ChatSliderMenu menuConfirmButtonText={menuConfirmButtonText} />}
|
||||||
|
|
||||||
<ChatSliderList />
|
{showList && <ChatSliderList />}
|
||||||
|
|
||||||
{showFooter && <ChatSliderFooter />}
|
{showFooter && <ChatSliderFooter />}
|
||||||
</MyBox>
|
</MyBox>
|
||||||
|
@@ -230,6 +230,8 @@ const OutLink = (props: Props) => {
|
|||||||
<SideBar externalTrigger={!!datasetCiteData}>{Children}</SideBar>
|
<SideBar externalTrigger={!!datasetCiteData}>{Children}</SideBar>
|
||||||
) : (
|
) : (
|
||||||
<ChatSliderMobileDrawer
|
<ChatSliderMobileDrawer
|
||||||
|
showHeader={false}
|
||||||
|
showFooter={false}
|
||||||
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
menuConfirmButtonText={t('common:core.chat.Confirm to clear history')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user