ui: ask for confirmation before deleting keys #520

pull/521/head
Marin 10 years ago
parent 3d3c48bd50
commit 99e572cffb

@ -161,13 +161,14 @@ App.KvShowController.reopen({
},
deleteFolder: function() {
this.set('isLoading', true);
this.set('isLoading', true);
var controller = this;
var dc = controller.get('dc').get('datacenter');
var grandParent = controller.get('grandParentKey');
var token = App.get('settings.token');
if (window.confirm("Are you sure you want to delete this folder?")) {
// Delete the folder
Ember.$.ajax({
url: (formatUrl("/v1/kv/" + controller.get('parentKey') + '?recurse', dc, token)),
@ -180,6 +181,7 @@ App.KvShowController.reopen({
});
}
}
}
});
App.KvEditController = KvBaseController.extend({
@ -219,14 +221,15 @@ App.KvEditController = KvBaseController.extend({
},
deleteKey: function() {
this.set('isLoading', true);
this.set('isLoading', true);
var controller = this;
var dc = controller.get('dc').get('datacenter');
var key = controller.get("model");
var parent = controller.getParentKeyRoute();
var token = App.get('settings.token');
if (window.confirm("Are you sure you want to delete this key?")) {
// Delete the key
Ember.$.ajax({
url: (formatUrl("/v1/kv/" + key.get('Key'), dc, token)),
@ -239,6 +242,7 @@ App.KvEditController = KvBaseController.extend({
});
}
}
}
});

Loading…
Cancel
Save