mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 15:06:50 +08:00
Fix: Updated color parsing functions and optimized component logic. (#10159)
### What problem does this PR solve? refactor(timeline, modal, dataflow-result, dataset-overview): Updated color parsing functions and optimized component logic. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
27
web/src/pages/dataset/dataset-overview/hook.ts
Normal file
27
web/src/pages/dataset/dataset-overview/hook.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import kbService from '@/services/knowledge-service';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useParams, useSearchParams } from 'umi';
|
||||
|
||||
export interface IOverviewTital {
|
||||
cancelled: number;
|
||||
failed: number;
|
||||
finished: number;
|
||||
processing: number;
|
||||
}
|
||||
const useFetchOverviewTital = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
const { id } = useParams();
|
||||
const knowledgeBaseId = searchParams.get('id') || id;
|
||||
const { data } = useQuery<IOverviewTital>({
|
||||
queryKey: ['overviewTital'],
|
||||
queryFn: async () => {
|
||||
const { data: res = {} } = await kbService.getKnowledgeBasicInfo({
|
||||
kb_id: knowledgeBaseId,
|
||||
});
|
||||
return res.data || [];
|
||||
},
|
||||
});
|
||||
return { data };
|
||||
};
|
||||
|
||||
export { useFetchOverviewTital };
|
||||
Reference in New Issue
Block a user