mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: support agent version history. (#6130)
### What problem does this PR solve? Add history version save - Allows users to view and download agent files by version revision history  _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -18,6 +18,10 @@ import {
|
||||
} from '../hooks/use-save-graph';
|
||||
import { BeginQuery } from '../interface';
|
||||
|
||||
import {
|
||||
HistoryVersionModal,
|
||||
useHistoryVersionModal,
|
||||
} from '../history-version-modal';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
@ -36,7 +40,8 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
|
||||
useShowEmbedModal();
|
||||
const isBeginNodeDataQuerySafe = useGetBeginNodeDataQueryIsSafe();
|
||||
|
||||
const { setVisibleHistoryVersionModal, visibleHistoryVersionModal } =
|
||||
useHistoryVersionModal();
|
||||
const handleShowEmbedModal = useCallback(() => {
|
||||
showEmbedModal();
|
||||
}, [showEmbedModal]);
|
||||
@ -50,6 +55,9 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
}
|
||||
}, [getBeginNodeDataQuery, handleRun, showChatDrawer]);
|
||||
|
||||
const showListVersion = useCallback(() => {
|
||||
setVisibleHistoryVersionModal(true);
|
||||
}, [setVisibleHistoryVersionModal]);
|
||||
return (
|
||||
<>
|
||||
<Flex
|
||||
@ -83,6 +91,9 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
>
|
||||
<b>{t('embedIntoSite', { keyPrefix: 'common' })}</b>
|
||||
</Button>
|
||||
<Button type="primary" onClick={showListVersion}>
|
||||
<b>{t('historyversion')}</b>
|
||||
</Button>
|
||||
</Space>
|
||||
</Flex>
|
||||
{embedVisible && (
|
||||
@ -95,6 +106,13 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
isAgent
|
||||
></EmbedModal>
|
||||
)}
|
||||
{visibleHistoryVersionModal && (
|
||||
<HistoryVersionModal
|
||||
id={id || ''}
|
||||
visible={visibleHistoryVersionModal}
|
||||
hideModal={() => setVisibleHistoryVersionModal(false)}
|
||||
></HistoryVersionModal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user