Implementation:Infiniflow Ragflow DatasetOverviewHooks
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Knowledge_Base |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Data-fetching hooks with pagination, search, and tab-switching for the dataset overview page.
Description
This module exports two hooks. useFetchOverviewTital uses React Query to fetch knowledge base summary info (doc count, chunk count) by KB ID from URL params. useFetchFileLogList is the primary hook that manages tab state (FILE_LOGS vs DATASET_LOGS), switches the fetch function between listDataPipelineLogDocument and listPipelineDatasetLogs accordingly, integrates pagination via useGetPaginationWithRouter, text search via useHandleSearchChange, and filter state via useHandleFilterSubmit. It resets pagination to page 1 on search input change.
Usage
Consumed by the dataset overview page component to drive the log table, pagination controls, filter toolbar, and summary statistics.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/pages/dataset/dataset-overview/hook.ts
- Lines: 1-98
Signature
const useFetchOverviewTital = () => { data };
const useFetchFileLogList = () => {
data, searchString, handleInputChange, pagination, setPagination,
active, setActive, filterValue, setFilterValue, handleFilterSubmit,
};
export { useFetchFileLogList, useFetchOverviewTital };
Import
import { useFetchFileLogList, useFetchOverviewTital } from './hook';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (URL params) | string | Yes | Knowledge base ID from route params or search params |
Outputs
| Name | Type | Description |
|---|---|---|
| data | IFileLogList / IOverviewTotal | Fetched log list or overview statistics |
| pagination | object | Current page, pageSize, total for pagination controls |
| active | LogTabs value | Currently selected log tab |
Usage Examples
const { data, pagination, setPagination, active, setActive } = useFetchFileLogList();
const { data: overviewData } = useFetchOverviewTital();