mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Import & export the agents. #3851 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { FileMimeType } from '@/constants/common';
|
||||
import fileManagerService from '@/services/file-manager-service';
|
||||
import { UploadFile } from 'antd';
|
||||
|
||||
@ -137,3 +138,11 @@ export const formatBytes = (x: string | number) => {
|
||||
|
||||
return n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + Units[l];
|
||||
};
|
||||
|
||||
export const downloadJsonFile = async (
|
||||
data: Record<string, any>,
|
||||
fileName: string,
|
||||
) => {
|
||||
const blob = new Blob([JSON.stringify(data)], { type: FileMimeType.Json });
|
||||
downloadFileFromBlob(blob, fileName);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user