feat(dataset): Added data pipeline configuration functionality #9869 (#10132)

### What problem does this PR solve?

feat(dataset): Added data pipeline configuration functionality #9869

- Added a data pipeline selection component to link data pipelines with
knowledge bases
- Added file filtering functionality, supporting custom file filtering
rules
- Optimized the configuration interface layout, adjusting style and
spacing
- Introduced new icons and buttons to enhance the user experience

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-09-18 09:31:57 +08:00
committed by GitHub
parent a7abc57f68
commit e82617f6de
25 changed files with 397 additions and 134 deletions

View File

@ -18,7 +18,7 @@ export const useNavigatePage = () => {
const navigateToDataset = useCallback(
(id: string) => () => {
navigate(`${Routes.Dataset}/${id}`);
navigate(`${Routes.DatasetBase}${Routes.DataSetOverview}/${id}`);
},
[navigate],
);

View File

@ -7,6 +7,7 @@ import {
IAgentLogsResponse,
IFlow,
IFlowTemplate,
IPipeLineListRequest,
ITraceData,
} from '@/interfaces/database/agent';
import { IDebugSingleRequestBody } from '@/interfaces/request/agent';
@ -16,6 +17,7 @@ import { IInputs } from '@/pages/agent/interface';
import { useGetSharedChatSearchParams } from '@/pages/chat/shared-hooks';
import agentService, {
fetchAgentLogsByCanvasId,
fetchPipeLineList,
fetchTrace,
} from '@/services/agent-service';
import api from '@/utils/api';
@ -648,3 +650,26 @@ export const useFetchPrompt = () => {
return { data, loading, refetch };
};
export const useFetchAgentList = ({
canvas_category = 'agent_canvas',
}: IPipeLineListRequest): {
data: {
canvas: IFlow[];
total: number;
};
loading: boolean;
} => {
const { data, isFetching: loading } = useQuery({
queryKey: ['fetchPipeLineList'],
initialData: [],
gcTime: 0,
queryFn: async () => {
const { data } = await fetchPipeLineList({ canvas_category });
return data?.data ?? [];
},
});
return { data, loading };
};

View File

@ -236,7 +236,11 @@ export const useUpdateKnowledge = (shouldFetchList = false) => {
return { data, loading, saveKnowledgeConfiguration: mutateAsync };
};
export const useFetchKnowledgeBaseConfiguration = (refreshCount?: number) => {
export const useFetchKnowledgeBaseConfiguration = (props?: {
isEdit?: boolean;
refreshCount?: number;
}) => {
const { isEdit = true, refreshCount } = props || { isEdit: true };
const { id } = useParams();
const [searchParams] = useSearchParams();
const knowledgeBaseId = searchParams.get('id') || id;
@ -253,10 +257,14 @@ export const useFetchKnowledgeBaseConfiguration = (refreshCount?: number) => {
initialData: {} as IKnowledge,
gcTime: 0,
queryFn: async () => {
const { data } = await kbService.get_kb_detail({
kb_id: knowledgeBaseId,
});
return data?.data ?? {};
if (isEdit) {
const { data } = await kbService.get_kb_detail({
kb_id: knowledgeBaseId,
});
return data?.data ?? {};
} else {
return {};
}
},
});