Feat: Create a data flow #9869 (#10131)

### What problem does this PR solve?

Feat: Create a data flow #9869

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-09-17 17:54:21 +08:00
committed by GitHub
parent ccb255919a
commit cf1f523d03
17 changed files with 189 additions and 299 deletions

View File

@ -61,6 +61,13 @@ export const useNavigatePage = () => {
[navigate],
);
const navigateToDataflow = useCallback(
(id: string) => () => {
navigate(`${Routes.DataFlow}/${id}`);
},
[navigate],
);
const navigateToAgentLogs = useCallback(
(id: string) => () => {
navigate(`${Routes.AgentLogPage}/${id}`);
@ -155,5 +162,6 @@ export const useNavigatePage = () => {
navigateToAgentList,
navigateToOldProfile,
navigateToDataflowResult,
navigateToDataflow,
};
};

View File

@ -271,6 +271,7 @@ export const useSetAgent = (showMessage: boolean = true) => {
title?: string;
dsl?: DSL;
avatar?: string;
canvas_category?: string;
}) => {
const { data = {} } = await agentService.setCanvas(params);
if (data.code === 0) {

View File

@ -1,6 +1,5 @@
import message from '@/components/ui/message';
import { IFlow } from '@/interfaces/database/agent';
import { Operator } from '@/pages/data-flow/constant';
import dataflowService from '@/services/dataflow-service';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';
@ -14,41 +13,6 @@ export const enum DataflowApiAction {
SetDataflow = 'setDataflow',
}
export const EmptyDsl = {
graph: {
nodes: [
{
id: Operator.Begin,
type: 'beginNode',
position: {
x: 50,
y: 200,
},
data: {
label: 'Begin',
name: Operator.Begin,
},
sourcePosition: 'left',
targetPosition: 'right',
},
],
edges: [],
},
components: {
begin: {
obj: {
component_name: 'Begin',
params: {},
},
downstream: [], // other edge target is downstream, edge source is current node id
upstream: [], // edge source is upstream, edge target is current node id
},
},
retrieval: [], // reference
history: [],
path: [],
};
export const useRemoveDataflow = () => {
const queryClient = useQueryClient();
const { t } = useTranslation();