1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

Feature/improve gallery interactivity (#6701)

* zip download images in gallery

* delete images in gallery

* clean up code

* update gallery context menu

* fix bug - select failed when gallery have several groups

* change function name

---------

Co-authored-by: Michael An <2331806369@qq.com>
This commit is contained in:
Aries
2024-09-21 16:41:21 +08:00
committed by GitHub
parent 1ea86d95b3
commit adf6591e59
8 changed files with 408 additions and 23 deletions

View File

@@ -221,6 +221,32 @@ class MetadataManagerAPI {
};
return this.req.post(url, params);
};
zipDownload(repoID, parent_dir, dirents) {
const url = this.server + '/api/v2.1/repos/' + repoID + '/zip-task/';
const form = new FormData();
form.append('parent_dir', parent_dir);
dirents.forEach(item => {
form.append('dirents', item);
});
return this._sendPostRequest(url, form);
}
/**
* Delete multiple files or folders in a repository, used to delete images in gallery originally
* @param {string} repoID - The ID of the repository
* @param {string[]} dirents - Array of file/folder paths to delete
* @returns {Promise} Axios delete request promise
*/
deleteImages(repoID, dirents) {
const url = this.server + '/api/v2.1/repos/batch-delete-folders-item/';
const data = {
repo_id: repoID,
file_names: dirents
};
return this.req.delete(url, { data });
}
}
const metadataAPI = new MetadataManagerAPI();