Add extract context menu item

This commit is contained in:
Girish Ramakrishnan
2020-10-19 19:18:47 -07:00
parent 58e4bd1077
commit 1e6ea77a8f
2 changed files with 29 additions and 2 deletions

View File

@@ -2585,8 +2585,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.filesExtract = function (appId, path, callback) {
put('/api/v1/apps/' + appId + '/files/' + path, { action: 'extract' }, {}, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
};
Client.prototype.filesChown = function (appId, path, uid, recursive, callback) {
put('/api/v1/apps/' + appId + '/files/' + path, { uid: uid, recursive: recursive }, {}, function (error, data, status) {
put('/api/v1/apps/' + appId + '/files/' + path, { action: 'chown', uid: uid, recursive: recursive }, {}, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -2595,7 +2604,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
};
Client.prototype.filesRename = function (appId, path, newPath, callback) {
put('/api/v1/apps/' + appId + '/files/' + path, { newFilePath: newPath }, {}, function (error, data, status) {
put('/api/v1/apps/' + appId + '/files/' + path, { action: 'rename', newFilePath: newPath }, {}, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));