1
0
Fork 0

added delete functionality

Esse commit está contido em:
Jon Lambson 2017-10-17 14:29:24 -06:00
commit e91d913547
2 arquivos alterados com 41 adições e 1 exclusões

Ver arquivo

@ -447,6 +447,46 @@ app.controller('websiteCtrl', [
vm.removeAllFiles = function (r, opts) {
console.log(r);
console.log(opts);
opts = {
path: '/',
confirm: true
};
vm.Sites.remove(r, opts);
};
vm.deleteFilesFrom = function (r, opts) {
var file = opts;
var requestedPath = vm.breadcrumbsPath.join('/') + '/' + file;
opts = {
path: requestedPath
};
vm.Sites.remove(r, opts);
};
vm.Sites.remove = function (r, opts) {
if (!window.confirm("Delete files for this site?")) {
return;
}
var pkg = Auth.oauth3.pkg('www@daplie.com');
debugger;
return pkg.remove({
hostname: r.domain,
domain: r.domain,
tld: r.tld,
sld: r.sld,
// sub: vm.record.sub,
path: opts.path || r.path,
confirm: opts.confirm || r.confirm
}).then(function (result) {
var msg = "'"+ vm.pathRemoved + "'" + ' has been removed';
vm.buildNotification(result, msg);
window.alert(JSON.stringify(result));
});
};

Ver arquivo

@ -81,7 +81,7 @@
</div>
<div class="row">
<div class="padding-side-15">
<button ng-if="r.shareAccess.write" type="button" class="btn btn-danger pull-right" ng-click="vm.deleteFilesFrom(r, path)"><i class="fa fa-trash"></i> Remove all Files</button>
<button ng-if="r.shareAccess.write" type="button" class="btn btn-danger pull-right" ng-click="vm.removeAllFiles(r, opts)"><i class="fa fa-trash"></i> Remove all Files</button>
</div>
</div>
</div>