Added copy, move and createFolder to clientlib
This commit is contained in:
parent
d719e3cdbf
commit
7671831707
1 changed files with 17 additions and 0 deletions
|
|
@ -73,6 +73,23 @@
|
|||
return OctoPrint.delete(resourceForFile(location, filename), opts);
|
||||
},
|
||||
|
||||
copy: function(location, filename, destination, opts) {
|
||||
return issueFileCommand(location, filename, "copy", { destination: destination }, opts);
|
||||
},
|
||||
|
||||
move: function(location, filename, destination, opts) {
|
||||
return issueFileCommand(location, filename, "move", { destination: destination }, opts);
|
||||
},
|
||||
|
||||
createFolder: function (location, name, path) {
|
||||
var data = { foldername: name };
|
||||
if (path != undefined && path != "") {
|
||||
data["foldername"] = path + "/" + name;
|
||||
}
|
||||
|
||||
return OctoPrint.postJson(resourceForLocation(location), data);
|
||||
},
|
||||
|
||||
upload: function (location, file, data) {
|
||||
data = data || {};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue