Feat: Import & export the agents. #3851 (#3894)

### 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:
balibabu
2024-12-06 13:43:17 +08:00
committed by GitHub
parent c76e7b1e28
commit e64c7dfdf6
12 changed files with 340 additions and 35 deletions

View File

@ -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);
};