diff --git a/web/app/components/datasets/hit-testing/components/result-item.tsx b/web/app/components/datasets/hit-testing/components/result-item.tsx index 5376e095d9..c18becd825 100644 --- a/web/app/components/datasets/hit-testing/components/result-item.tsx +++ b/web/app/components/datasets/hit-testing/components/result-item.tsx @@ -17,15 +17,18 @@ import Tag from '@/app/components/datasets/documents/detail/completed/common/tag const i18nPrefix = 'datasetHitTesting' type Props = { + isExternal: boolean payload: HitTesting } const ResultItem: FC = ({ + isExternal, payload, }) => { const { t } = useTranslation() - const { segment, score, child_chunks } = payload - const { position, word_count, content, keywords, document } = segment + const { segment, content: externalContent, score, child_chunks } = payload + const data = isExternal ? externalContent : segment + const { position, word_count, content, keywords, document } = data const isParentChildRetrieval = !!(child_chunks && child_chunks.length > 0) const extension = document.name.split('.').slice(-1)[0] as FileAppearanceTypeEnum const [isFold, { diff --git a/web/app/components/datasets/hit-testing/index.tsx b/web/app/components/datasets/hit-testing/index.tsx index 2a0a4aeb8a..969768f2c0 100644 --- a/web/app/components/datasets/hit-testing/index.tsx +++ b/web/app/components/datasets/hit-testing/index.tsx @@ -9,13 +9,12 @@ import { useContext } from 'use-context-selector' import SegmentCard from '../documents/detail/completed/SegmentCard' import Textarea from './textarea' import s from './style.module.css' -import HitDetail from './hit-detail' +// import HitDetail from './hit-detail' import ModifyRetrievalModal from './modify-retrieval-modal' import ResultItem from './components/result-item' import cn from '@/utils/classnames' import type { ExternalKnowledgeBaseHitTestingResponse, ExternalKnowledgeBaseHitTesting as ExternalKnowledgeBaseHitTestingType, HitTestingResponse, HitTesting as HitTestingType } from '@/models/datasets' import Loading from '@/app/components/base/loading' -import Modal from '@/app/components/base/modal' import Drawer from '@/app/components/base/drawer' import Pagination from '@/app/components/base/pagination' import FloatRightContainer from '@/app/components/base/float-right-container' @@ -82,6 +81,7 @@ const HitTesting: FC = ({ datasetId }: Props) => { ))} @@ -194,7 +194,7 @@ const HitTesting: FC = ({ datasetId }: Props) => { } - { @@ -216,7 +216,7 @@ const HitTesting: FC = ({ datasetId }: Props) => { }} /> )} - + */} setIsShowModifyRetrievalModal(false)} footer={null} mask={isMobile} panelClassname='mt-16 mx-2 sm:mr-2 mb-3 !p-0 !max-w-[640px] rounded-xl'>