Explorar el Código

FIX: knowledge will not render a paginator when count is greater than 30 (#7596)

### What problem does this PR solve?

as https://github.com/infiniflow/ragflow/issues/7538
and https://github.com/infiniflow/ragflow/pull/7550

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.19.0
Stephen Hu hace 5 meses
padre
commit
d06431f670
No account linked to committer's email address
Se han modificado 1 ficheros con 38 adiciones y 26 borrados
  1. 38
    26
      web/src/pages/knowledge/index.tsx

+ 38
- 26
web/src/pages/knowledge/index.tsx Ver fichero

@@ -50,7 +50,7 @@ const KnowledgeList = () => {
}, [data?.pages]);

return (
<Flex className={styles.knowledge} vertical flex={1} id="scrollableDiv">
<Flex className={styles.knowledge} vertical flex={1}>
<div className={styles.topWrapper}>
<div>
<span className={styles.title}>
@@ -79,33 +79,45 @@ const KnowledgeList = () => {
</Space>
</div>
<Spin spinning={loading}>
<InfiniteScroll
dataLength={nextList?.length ?? 0}
next={fetchNextPage}
hasMore={hasNextPage}
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
endMessage={!!total && <Divider plain>{t('noMoreData')} 🤐</Divider>}
scrollableTarget="scrollableDiv"
<div
id="scrollableDiv"
style={{
height: 'calc(100vh - 250px)',
overflow: 'auto',
padding: '0 16px',
}}
>
<Flex
gap={'large'}
wrap="wrap"
className={styles.knowledgeCardContainer}
<InfiniteScroll
dataLength={nextList?.length ?? 0}
next={fetchNextPage}
hasMore={hasNextPage}
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
endMessage={
!!total && <Divider plain>{t('noMoreData')} 🤐</Divider>
}
scrollableTarget="scrollableDiv"
scrollThreshold="200px"
>
{nextList?.length > 0 ? (
nextList.map((item: any, index: number) => {
return (
<KnowledgeCard
item={item}
key={`${item?.name}-${index}`}
></KnowledgeCard>
);
})
) : (
<Empty className={styles.knowledgeEmpty}></Empty>
)}
</Flex>
</InfiniteScroll>
<Flex
gap={'large'}
wrap="wrap"
className={styles.knowledgeCardContainer}
>
{nextList?.length > 0 ? (
nextList.map((item: any, index: number) => {
return (
<KnowledgeCard
item={item}
key={`${item?.name}-${index}`}
></KnowledgeCard>
);
})
) : (
<Empty className={styles.knowledgeEmpty}></Empty>
)}
</Flex>
</InfiniteScroll>
</div>
</Spin>
<KnowledgeCreatingModal
loading={creatingLoading}

Cargando…
Cancelar
Guardar