cloudStack 3.0 new UI - zone chart - F5 device - implement Delete action.

This commit is contained in:
Jessica Wang 2011-11-23 14:33:36 -08:00
parent c3588083f6
commit c962af67bc
2 changed files with 43 additions and 4 deletions

View File

@ -37,7 +37,8 @@ var pollAsyncJobResult = function(args) {
var result = json.queryasyncjobresultresponse;
if (result.jobstatus == 0) {
return; //Job has not completed
} else {
}
else {
if (result.jobstatus == 1) { // Succeeded
if(args._custom.getUpdatedItem != null && args._custom.getActionFilter != null) {
args.complete({
@ -54,8 +55,9 @@ var pollAsyncJobResult = function(args) {
args.complete();
}
}
else if (result.jobstatus == 2) { // Failed
args.error({message:result.jobresult.errortext});
else if (result.jobstatus == 2) { // Failed
var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext;
args.error({message: msg});
}
}
},

View File

@ -1446,7 +1446,44 @@
});
},
detailView: {
name: 'F5 details',
name: 'F5 details',
actions: {
'delete': {
label: 'Delete F5',
messages: {
confirm: function(args) {
return 'Are you sure you want to delete this F5?';
},
success: function(args) {
return 'F5 is being deleted.';
},
notification: function(args) {
return 'Deleting F5';
},
complete: function(args) {
return 'F5 has been deleted.';
}
},
action: function(args) {
$.ajax({
url: createURL("deleteF5LoadBalancer&lbdeviceid=" + args.context.f5Providers[0].lbdeviceid),
dataType: "json",
async: true,
success: function(json) {
var jid = json.deletef5loadbalancerresponse.jobid;
args.response.success(
{_custom:
{jobId: jid}
}
);
}
});
},
notification: {
poll: pollAsyncJobResult
}
}
},
tabs: {
details: {
title: 'Details',