mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(rest) add unzip
This commit is contained in:
parent
83aa10660c
commit
41654e09d3
12 changed files with 66 additions and 4 deletions
|
|
@ -602,6 +602,23 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
RESTful.zip(fileFrom, CloudCmd.refresh);
|
||||
};
|
||||
|
||||
/**
|
||||
* unzip file
|
||||
*
|
||||
*/
|
||||
this.unzipFile = function() {
|
||||
var RESTful = DOM.RESTful,
|
||||
name = Cmd.getCurrentName(),
|
||||
dir = Cmd.getCurrentDirPath(),
|
||||
path = dir + name,
|
||||
fileFrom = {
|
||||
from : path
|
||||
};
|
||||
|
||||
if (name && name !== '..')
|
||||
RESTful.unzip(fileFrom, CloudCmd.refresh);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* prompt and delete current file or selected files
|
||||
|
|
|
|||
|
|
@ -189,7 +189,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
},
|
||||
'Delete' : DOM.promptDelete,
|
||||
'(Un)Select All': DOM.toggleAllSelectedFiles,
|
||||
'Zip file' : DOM.zipFile
|
||||
'Zip file' : DOM.zipFile,
|
||||
'Unzip file' : DOM.unzipFile
|
||||
};
|
||||
|
||||
if (UploadToItemNames.length)
|
||||
|
|
|
|||
|
|
@ -62,6 +62,15 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
});
|
||||
};
|
||||
|
||||
this.unzip = function(data, callback) {
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
url : '/unzip',
|
||||
data : data,
|
||||
callback : callback
|
||||
});
|
||||
};
|
||||
|
||||
this.mv = function(data, callback) {
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue