Feat: Replace the link of the old version of the agent module #3221 (#9130)

### What problem does this PR solve?
Feat: Automatically save agent canvas content
Feat: Replace the link of the old version of the agent module #3221
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-07-31 12:14:00 +08:00
committed by GitHub
parent e9c5c7bc7c
commit 0327fd848e
13 changed files with 77 additions and 44 deletions

View File

@ -4,16 +4,16 @@ import {
useSetAgent,
} from '@/hooks/use-agent-request';
import { RAGFlowNodeType } from '@/interfaces/database/flow';
import { formatDate } from '@/utils/date';
import { useDebounceEffect } from 'ahooks';
import dayjs from 'dayjs';
import { useCallback, useEffect, useState } from 'react';
import { useParams } from 'umi';
import useGraphStore from '../store';
import { useBuildDslData } from './use-build-dsl';
export const useSaveGraph = () => {
export const useSaveGraph = (showMessage: boolean = true) => {
const { data } = useFetchAgent();
const { setAgent, loading } = useSetAgent();
const { setAgent, loading } = useSetAgent(showMessage);
const { id } = useParams();
const { buildDslData } = useBuildDslData();
@ -57,11 +57,11 @@ export const useWatchAgentChange = (chatDrawerVisible: boolean) => {
const [time, setTime] = useState<string>();
const nodes = useGraphStore((state) => state.nodes);
const edges = useGraphStore((state) => state.edges);
const { saveGraph } = useSaveGraph();
const { saveGraph } = useSaveGraph(false);
const { data: flowDetail } = useFetchAgent();
const setSaveTime = useCallback((updateTime: number) => {
setTime(dayjs(updateTime).format('YYYY-MM-DD HH:mm:ss'));
setTime(formatDate(updateTime));
}, []);
useEffect(() => {
@ -77,7 +77,7 @@ export const useWatchAgentChange = (chatDrawerVisible: boolean) => {
useDebounceEffect(
() => {
// saveAgent();
saveAgent();
},
[nodes, edges],
{