mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-03 02:55:29 +08:00
### What problem does this PR solve? Feat: Modify the data structure of the chunk in the conversation #3909 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -29,18 +29,20 @@ import {
|
||||
useSelectDerivedConversationList,
|
||||
} from './hooks';
|
||||
|
||||
import EmbedModal from '@/components/api-service/embed-modal';
|
||||
import { useShowEmbedModal } from '@/components/api-service/hooks';
|
||||
import SvgIcon from '@/components/svg-icon';
|
||||
import { useTheme } from '@/components/theme-provider';
|
||||
import { SharedFrom } from '@/constants/chat';
|
||||
import {
|
||||
useClickConversationCard,
|
||||
useClickDialogCard,
|
||||
useFetchNextDialogList,
|
||||
useGetChatSearchParams,
|
||||
} from '@/hooks/chat-hooks';
|
||||
import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useSetSelectedRecord } from '@/hooks/logic-hooks';
|
||||
import { IDialog } from '@/interfaces/database/chat';
|
||||
import ChatIdModal from './chat-id-modal';
|
||||
import styles from './index.less';
|
||||
|
||||
const { Text } = Typography;
|
||||
@ -82,13 +84,10 @@ const Chat = () => {
|
||||
showDialogEditModal,
|
||||
} = useEditDialog();
|
||||
const { t } = useTranslate('chat');
|
||||
const {
|
||||
visible: overviewVisible,
|
||||
hideModal: hideOverviewModal,
|
||||
showModal: showOverviewModal,
|
||||
} = useSetModalState();
|
||||
const { currentRecord, setRecord } = useSetSelectedRecord<IDialog>();
|
||||
const [controller, setController] = useState(new AbortController());
|
||||
const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
|
||||
useShowEmbedModal();
|
||||
|
||||
const handleAppCardEnter = (id: string) => () => {
|
||||
handleItemEnter(id);
|
||||
@ -120,7 +119,7 @@ const Chat = () => {
|
||||
info?.domEvent?.preventDefault();
|
||||
info?.domEvent?.stopPropagation();
|
||||
setRecord(dialog);
|
||||
showOverviewModal();
|
||||
showEmbedModal();
|
||||
};
|
||||
|
||||
const handleRemoveConversation =
|
||||
@ -193,7 +192,7 @@ const Chat = () => {
|
||||
label: (
|
||||
<Space>
|
||||
<KeyOutlined />
|
||||
{t('overview')}
|
||||
{t('publish', { keyPrefix: 'flow' })}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@ -374,14 +373,16 @@ const Chat = () => {
|
||||
initialName={initialConversationName}
|
||||
loading={conversationRenameLoading}
|
||||
></RenameModal>
|
||||
{overviewVisible && (
|
||||
<ChatIdModal
|
||||
visible={overviewVisible}
|
||||
hideModal={hideOverviewModal}
|
||||
id={currentRecord.id}
|
||||
name={currentRecord.name}
|
||||
idKey="dialogId"
|
||||
></ChatIdModal>
|
||||
|
||||
{embedVisible && (
|
||||
<EmbedModal
|
||||
visible={embedVisible}
|
||||
hideModal={hideEmbedModal}
|
||||
token={currentRecord.id}
|
||||
form={SharedFrom.Chat}
|
||||
beta={beta}
|
||||
isAgent={false}
|
||||
></EmbedModal>
|
||||
)}
|
||||
</Flex>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user