Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const DocumentDetails: FC = () => {
const [infoItems, setInfoItems] = useState<InfoItem[]>([]);
const [page, setPage] = useState(1);
const [hasMore, setHasMore] = useState(true);
const [total, setTotal] = useState(0);
const [chunkLoading, setChunkLoading] = useState(false);
const [keywords, setKeywords] = useState('');
const [fileUrl, setFileUrl] = useState('');
Expand Down Expand Up @@ -219,6 +220,7 @@ const DocumentDetails: FC = () => {
}

setHasMore(response.page?.has_next ?? false);
setTotal(response.page?.total ?? 0);
} catch (error) {
console.error('Failed to fetch document details:', error);
message.error(t('common.loadFailed') || '加载失败');
Expand Down Expand Up @@ -472,6 +474,7 @@ const DocumentDetails: FC = () => {
<RecallTestResult
refresh={refreshChunks}
data={chunkList}
total={total}
showEmpty={false}
hasMore={hasMore}
loadMore={loadMoreChunks}
Expand Down
4 changes: 3 additions & 1 deletion web/src/views/KnowledgeBase/components/RecallTestResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface RecallTestResultProps {
data: RecallTestData[];
showEmpty?: boolean;
hasMore?: boolean;
total?: number;
loadMore?: () => void;
refresh?: () => void;
loading?: boolean;
Expand All @@ -38,6 +39,7 @@ const RecallTestResult = ({
data,
showEmpty = true,
hasMore = false,
total = 0,
loadMore,
refresh,
loading = false,
Expand Down Expand Up @@ -395,7 +397,7 @@ const RecallTestResult = ({
<div className='rb:flex rb:items-center rb:justify-start rb:gap-2'>
<span className='rb:text-lg rb:font-medium'>{t('knowledgeBase.recallResult')}</span>
<span className='rb:text-gray-500 rb:text-xs rb:pt-0.5'>
(<span className='rb:text-[#155EEF]'>{data.length}</span> results)
(<span className='rb:text-[#155EEF]'>{total || data.length}</span> results)
</span>
</div>
<InfiniteScroll
Expand Down
Loading