Skip to content

Commit

Permalink
fix: ts
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Mar 7, 2024
1 parent a9d570b commit 3105af4
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 111 deletions.
2 changes: 1 addition & 1 deletion projects/app/public/docs/versionIntro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Fast GPT V4.6.8
### Fast GPT V4.6.9

1. 新增 - 知识库新增“增强处理”训练模式,可生成更多类型索引。
2. 新增 - 完善了HTTP模块的变量提示。
Expand Down
75 changes: 38 additions & 37 deletions projects/app/src/pages/chat/components/ChatHistorySlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const ChatHistorySlider = ({
placeholder: t('core.chat.Custom History Title Description')
});
const { openConfirm, ConfirmModal } = useConfirm({
content: t(confirmClearText)
content: confirmClearText
});

const concatHistory = useMemo<HistoryItemType[]>(
Expand Down Expand Up @@ -204,14 +204,14 @@ const ChatHistorySlider = ({
bg={item.top ? '#E6F6F6 !important' : ''}
{...(item.id === activeChatId
? {
backgroundColor: 'primary.50 !important',
color: 'primary.600'
}
: {
onClick: () => {
onChangeChat(item.id);
backgroundColor: 'primary.50 !important',
color: 'primary.600'
}
})}
: {
onClick: () => {
onChangeChat(item.id);
}
})}
>
<MyIcon
name={item.id === activeChatId ? 'core/chat/chatFill' : 'core/chat/chatLight'}
Expand Down Expand Up @@ -286,36 +286,37 @@ const ChatHistorySlider = ({
)}
{currentTab === TabEnum.app && !isPc && (
<>
{Array.isArray(apps) && apps.map((item) => (
<Flex
key={item._id}
py={2}
px={3}
mb={3}
borderRadius={'md'}
alignItems={'center'}
{...(item._id === appId
? {
backgroundColor: 'primary.50 !important',
color: 'primary.600'
}
: {
onClick: () => {
router.replace({
query: {
appId: item._id
{Array.isArray(apps) &&
apps.map((item) => (
<Flex
key={item._id}
py={2}
px={3}
mb={3}
borderRadius={'md'}
alignItems={'center'}
{...(item._id === appId
? {
backgroundColor: 'primary.50 !important',
color: 'primary.600'
}
: {
onClick: () => {
router.replace({
query: {
appId: item._id
}
});
onClose();
}
});
onClose();
}
})}
>
<Avatar src={item.avatar} w={'24px'} />
<Box ml={2} className={'textEllipsis'}>
{item.name}
</Box>
</Flex>
))}
})}
>
<Avatar src={item.avatar} w={'24px'} />
<Box ml={2} className={'textEllipsis'}>
{item.name}
</Box>
</Flex>
))}
</>
)}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
})(
<ChatHistorySlider
apps={myApps}
confirmClearText={'core.chat.Confirm to clear history'}
confirmClearText={t('core.chat.Confirm to clear history')}
appId={appId}
appName={chatData.app.name}
appAvatar={chatData.app.avatar}
Expand Down
140 changes: 70 additions & 70 deletions projects/app/src/pages/chat/share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,78 +278,78 @@ const OutLink = ({
>
{showHistory === '1'
? ((children: React.ReactNode) => {
return isPc ? (
<SideBar>{children}</SideBar>
) : (
<Drawer
isOpen={isOpenSlider}
placement="left"
autoFocus={false}
size={'xs'}
return isPc ? (
<SideBar>{children}</SideBar>
) : (
<Drawer
isOpen={isOpenSlider}
placement="left"
autoFocus={false}
size={'xs'}
onClose={onCloseSlider}
>
<DrawerOverlay backgroundColor={'rgba(255,255,255,0.5)'} />
<DrawerContent maxWidth={'250px'} boxShadow={'2px 0 10px rgba(0,0,0,0.15)'}>
{children}
</DrawerContent>
</Drawer>
);
})(
<ChatHistorySlider
appName={chatData.app.name}
appAvatar={chatData.app.avatar}
confirmClearText={t('core.chat.Confirm to clear share chat history')}
activeChatId={chatId}
history={histories.map((item) => ({
id: item.chatId,
title: item.title,
customTitle: item.customTitle,
top: item.top
}))}
onClose={onCloseSlider}
>
<DrawerOverlay backgroundColor={'rgba(255,255,255,0.5)'} />
<DrawerContent maxWidth={'250px'} boxShadow={'2px 0 10px rgba(0,0,0,0.15)'}>
{children}
</DrawerContent>
</Drawer>
);
})(
<ChatHistorySlider
appName={chatData.app.name}
appAvatar={chatData.app.avatar}
confirmClearText={'core.chat.Confirm to clear share chat history'}
activeChatId={chatId}
history={histories.map((item) => ({
id: item.chatId,
title: item.title,
customTitle: item.customTitle,
top: item.top
}))}
onClose={onCloseSlider}
onChangeChat={(chatId) => {
router.replace({
query: {
...router.query,
chatId: chatId || ''
onChangeChat={(chatId) => {
router.replace({
query: {
...router.query,
chatId: chatId || ''
}
});
if (!isPc) {
onCloseSlider();
}
});
if (!isPc) {
onCloseSlider();
}}
onDelHistory={({ chatId }) =>
delOneHistory({ appId: chatData.appId, chatId, shareId, outLinkUid })
}
}}
onDelHistory={({ chatId }) =>
delOneHistory({ appId: chatData.appId, chatId, shareId, outLinkUid })
}
onClearHistory={() => {
clearHistories({ shareId, outLinkUid });
router.replace({
query: {
...router.query,
chatId: ''
}
});
}}
onSetHistoryTop={(e) => {
updateHistory({
...e,
appId: chatData.appId,
shareId,
outLinkUid
});
}}
onSetCustomTitle={async (e) => {
updateHistory({
appId: chatData.appId,
chatId: e.chatId,
title: e.title,
customTitle: e.title,
shareId,
outLinkUid
});
}}
/>
)
onClearHistory={() => {
clearHistories({ shareId, outLinkUid });
router.replace({
query: {
...router.query,
chatId: ''
}
});
}}
onSetHistoryTop={(e) => {
updateHistory({
...e,
appId: chatData.appId,
shareId,
outLinkUid
});
}}
onSetCustomTitle={async (e) => {
updateHistory({
appId: chatData.appId,
chatId: e.chatId,
title: e.title,
customTitle: e.title,
shareId,
outLinkUid
});
}}
/>
)
: null}

{/* chat container */}
Expand Down Expand Up @@ -378,7 +378,7 @@ const OutLink = ({
userGuideModule={chatData.app?.userGuideModule}
showFileSelector={checkChatSupportSelectFileByChatModels(chatData.app.chatModels)}
feedbackType={'user'}
onUpdateVariable={(e) => { }}
onUpdateVariable={(e) => {}}
onStartChat={startChat}
onDelMessage={(e) =>
delOneHistoryItem({ ...e, appId: chatData.appId, chatId, shareId, outLinkUid })
Expand Down
4 changes: 2 additions & 2 deletions projects/app/src/pages/chat/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ const OutLink = ({
appName={chatData.app.name}
appAvatar={chatData.app.avatar}
activeChatId={chatId}
confirmClearText={t('core.chat.Confirm to clear history')}
onClose={onCloseSlider}
isTeamShare
history={histories.map((item, i) => ({
id: item.chatId,
title: item.title,
Expand Down Expand Up @@ -364,7 +364,7 @@ const OutLink = ({
userGuideModule={chatData.app?.userGuideModule}
showFileSelector={checkChatSupportSelectFileByChatModels(chatData.app.chatModels)}
feedbackType={'user'}
onUpdateVariable={(e) => { }}
onUpdateVariable={(e) => {}}
onStartChat={startChat}
onDelMessage={(e) =>
delOneHistoryItem({ ...e, appId: chatData.appId, chatId, teamId, teamToken })
Expand Down

0 comments on commit 3105af4

Please sign in to comment.