1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-03-04 13:04:13 +08:00

63 lines
1.8 KiB
Go
Raw Normal View History

2022-08-24 11:10:50 +08:00
import { File } from '@/api/interface/file';
import http from '@/api';
2022-08-19 16:02:58 +08:00
2022-08-24 11:10:50 +08:00
export const GetFilesList = (params: File.ReqFile) => {
return http.post<File.File>('files/search', params);
2022-08-19 16:02:58 +08:00
};
2022-08-24 17:34:21 +08:00
export const GetFilesTree = (params: File.ReqFile) => {
return http.post<File.FileTree[]>('files/tree', params);
};
2022-08-25 17:54:52 +08:00
export const CreateFile = (form: File.FileCreate) => {
return http.post<File.File>('files', form);
};
2022-08-25 18:48:03 +08:00
export const DeleteFile = (form: File.FileDelete) => {
return http.post<File.File>('files/del', form);
};
export const ChangeFileMode = (form: File.FileCreate) => {
2022-09-01 19:02:33 +08:00
return http.post<File.File>('files/mode', form);
2022-08-30 17:59:59 +08:00
};
export const CompressFile = (form: File.FileCompress) => {
2022-09-01 19:02:33 +08:00
return http.post<File.File>('files/compress', form);
};
2022-09-01 19:02:33 +08:00
2022-08-31 13:59:02 +08:00
export const DeCompressFile = (form: File.FileDeCompress) => {
2022-09-01 19:02:33 +08:00
return http.post<File.File>('files/decompress', form);
};
export const GetFileContent = (params: File.ReqFile) => {
return http.post<File.File>('files/content', params);
};
export const SaveFileContent = (params: File.FileEdit) => {
return http.post<File.File>('files/save', params);
2022-08-31 13:59:02 +08:00
};
2022-09-03 18:41:52 +08:00
export const UploadFileData = (params: FormData) => {
return http.post<File.File>('files/upload', params);
};
2022-09-03 22:22:40 +08:00
export const RenameRile = (params: File.FileRename) => {
return http.post<File.File>('files/rename', params);
};
2022-09-05 16:25:26 +08:00
2022-09-06 17:48:49 +08:00
export const WgetFile = (params: File.FileWget) => {
return http.post<File.File>('files/wget', params);
2022-09-05 16:25:26 +08:00
};
2022-09-06 10:35:35 +08:00
export const MoveFile = (params: File.FileMove) => {
return http.post<File.File>('files/move', params);
};
2022-09-06 17:48:49 +08:00
export const DownloadFile = (params: File.FileDownload) => {
return http.download<BlobPart>('files/download', params, { responseType: 'blob' });
};
export const ComputeDirSize = (params: File.DirSizeReq) => {
return http.post<File.DirSizeRes>('files/size', params);
};