Add server download task creation and related UI components

This commit is contained in:
2025-05-26 20:51:02 +08:00
parent 764ec5f38c
commit 7e612b3dd4
7 changed files with 324 additions and 18 deletions

View File

@@ -666,6 +666,27 @@ class Network {
}
}
async createServerDownloadTask(url: string, filename: string, description: string,
resourceId: number, storageId: number): Promise<Response<RFile>> {
try {
const response = await axios.post(`${this.apiBaseUrl}/files/upload/url`, {
url,
filename,
description,
resource_id: resourceId,
storage_id: storageId
});
return response.data;
}
catch (e: any) {
console.error(e);
return {
success: false,
message: e.toString(),
};
}
}
async getFile(fileId: string): Promise<Response<RFile>> {
try {
const response = await axios.get(`${this.apiBaseUrl}/files/${fileId}`);