diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index cd992486247..79204919f07 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -180,150 +180,7 @@ }); } } - }, - - disable: { - label: 'Disable account', - messages: { - confirm: function(args) { - return 'Are you sure you want to disable this account?'; - }, - notification: function(args) { - return 'Disabling account'; - } - }, - action: function(args) { - var accountObj = args.context.accounts[0]; - $.ajax({ - url: createURL("disableAccount&lock=false&domainid=" + accountObj.domainid + "&account=" + accountObj.name), - dataType: "json", - async: true, - success: function(json) { - var jid = json.disableaccountresponse.jobid; - args.response.success( - {_custom: - {jobId: jid, - getUpdatedItem: function(json) { - return json.queryasyncjobresultresponse.jobresult.account; - }, - getActionFilter: function() { - return accountActionfilter; - } - } - } - ); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - - lock: { - label: 'Lock account', - messages: { - confirm: function(args) { - return 'Are you sure you want to lock this account?'; - }, - notification: function(args) { - return 'Locking account'; - } - }, - action: function(args) { - var accountObj = args.context.accounts[0]; - $.ajax({ - url: createURL("disableAccount&lock=true&domainid=" + accountObj.domainid + "&account=" + accountObj.name), - dataType: "json", - async: true, - success: function(json) { - var jid = json.disableaccountresponse.jobid; - args.response.success( - {_custom: - {jobId: jid, - getUpdatedItem: function(json) { - return json.queryasyncjobresultresponse.jobresult.account; - }, - getActionFilter: function() { - return accountActionfilter; - } - } - } - ); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - - enable: { - label: 'Enable account', - messages: { - confirm: function(args) { - return 'Are you sure you want to enable this account?'; - }, - notification: function(args) { - return 'Enabling account'; - } - }, - action: function(args) { - var accountObj = args.context.accounts[0]; - $.ajax({ - url: createURL("enableAccount&domainid=" + accountObj.domainid + "&account=" + accountObj.name), - dataType: "json", - async: true, - success: function(json) { - args.response.success({data: json.enableaccountresponse.account}); - } - }); - }, - notification: { - poll: function(args) { - args.complete({ - data: { state: 'enabled' } - }); - } - } - }, - - destroy: { - label: 'Delete account', - messages: { - confirm: function(args) { - return 'Are you sure you want to delete this account?'; - }, - notification: function(args) { - return 'Deleting account'; - } - }, - action: function(args) { - $.ajax({ - url: createURL("deleteAccount&id=" + args.context.accounts[0].id), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deleteaccountresponse.jobid; - args.response.success( - {_custom: - {jobId: jid, - getUpdatedItem: function(json) { - return {state: 'Destroyed'}; //nothing in this account needs to be updated, in fact, this whole account has being deleted - }, - getActionFilter: function() { - return accountActionfilter; - } - } - } - ); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - } + } }, dataProvider: function(args) {