cloudstack 3.0 new UI - account page - from actions from listView since they are available in detailView.

This commit is contained in:
Jessica Wang 2012-01-06 15:26:05 -08:00
parent 4b33eef8d5
commit e77373949b
1 changed files with 1 additions and 144 deletions

View File

@ -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) {