feat: Automatically save agent page data #3301 (#3302)

### What problem does this PR solve?

feat: Automatically save agent page data #3301

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-11-08 17:28:11 +08:00
committed by GitHub
parent 464a4d6ead
commit 74d1eeb4d3
10 changed files with 105 additions and 23 deletions

View File

@ -5,7 +5,11 @@ import { ArrowLeftOutlined } from '@ant-design/icons';
import { Button, Flex, Space } from 'antd';
import { Link, useParams } from 'umi';
import FlowIdModal from '../flow-id-modal';
import { useSaveGraph, useSaveGraphBeforeOpeningDebugDrawer } from '../hooks';
import {
useSaveGraph,
useSaveGraphBeforeOpeningDebugDrawer,
useWatchAgentChange,
} from '../hooks';
import styles from './index.less';
interface IProps {
@ -20,10 +24,11 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
const {
visible: overviewVisible,
hideModal: hideOverviewModal,
showModal: showOverviewModal,
// showModal: showOverviewModal,
} = useSetModalState();
const { visible, hideModal, showModal } = useSetModalState();
const { id } = useParams();
const time = useWatchAgentChange();
return (
<>
@ -37,7 +42,10 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
<Link to={`/flow`}>
<ArrowLeftOutlined />
</Link>
<h3>{data.title}</h3>
<div className="flex flex-col">
<span className="font-semibold text-[18px]">{data.title}</span>
<span className="font-normal text-sm"> {time}</span>
</div>
</Space>
<Space size={'large'}>
<Button onClick={handleRun}>