Files
ragflow/web/src/services/flow-service.ts
so95 53ac27c3ff 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

![image](https://github.com/user-attachments/assets/c300375d-8b97-4230-9fc4-83d148137132)

_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>
2025-03-19 15:22:53 +08:00

79 lines
1.3 KiB
TypeScript

import api from '@/utils/api';
import registerServer from '@/utils/register-server';
import request from '@/utils/request';
const {
getCanvas,
getCanvasSSE,
setCanvas,
getListVersion,
getVersion,
listCanvas,
resetCanvas,
removeCanvas,
runCanvas,
listTemplates,
testDbConnect,
getInputElements,
debug,
} = api;
const methods = {
getCanvas: {
url: getCanvas,
method: 'get',
},
getCanvasSSE: {
url: getCanvasSSE,
method: 'get',
},
setCanvas: {
url: setCanvas,
method: 'post',
},
getListVersion: {
url: getListVersion,
method: 'get',
},
getVersion: {
url: getVersion,
method: 'get',
},
listCanvas: {
url: listCanvas,
method: 'get',
},
resetCanvas: {
url: resetCanvas,
method: 'post',
},
removeCanvas: {
url: removeCanvas,
method: 'post',
},
runCanvas: {
url: runCanvas,
method: 'post',
},
listTemplates: {
url: listTemplates,
method: 'get',
},
testDbConnect: {
url: testDbConnect,
method: 'post',
},
getInputElements: {
url: getInputElements,
method: 'get',
},
debugSingle: {
url: debug,
method: 'post',
},
} as const;
const flowService = registerServer<keyof typeof methods>(methods, request);
export default flowService;