Merge pull request #1154 from ustcweizhou/fix-ui-delete-sshkey-projects

[UI] fix bug: Cannot delete SSH keypairs in projectsBefore change:
error message: ProjectId and account/domainId can't be specified together

After change:
SSH keypairs can be removed

* pr/1154:
  [UI] fix bug: Cannot delete SSH keypairs in projects

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-12-07 11:08:11 +05:30
commit 9ce133401c

View File

@ -1876,10 +1876,14 @@
}, },
action: function(args) { action: function(args) {
var data = { var data = {
domainid: args.context.sshkeypairs[0].domainid,
account: args.context.sshkeypairs[0].account,
name: args.context.sshkeypairs[0].name name: args.context.sshkeypairs[0].name
}; };
if (!args.context.projects) {
$.extend(data, {
domainid: args.context.sshkeypairs[0].domainid,
account: args.context.sshkeypairs[0].account,
});
}
$.ajax({ $.ajax({
url: createURL('deleteSSHKeyPair'), url: createURL('deleteSSHKeyPair'),
data: data, data: data,