bug 12910: cloudstack 3.0 new UI - router page - add "Destroy" action.

This commit is contained in:
Jessica Wang 2012-01-11 15:12:22 -08:00
parent 0fac4a2bb1
commit 45f9701c63

View File

@ -1581,7 +1581,37 @@
poll: pollAsyncJobResult poll: pollAsyncJobResult
} }
}, },
'destroy': {
label: 'Destroy router',
messages: {
confirm: function(args) {
return 'Are you sure you want to destroy router?';
},
notification: function(args) {
return 'Destroy router';
}
},
action: function(args) {
$.ajax({
url: createURL("destroyRouter&id=" + args.context.routers[0].id),
dataType: "json",
async: true,
success: function(json) {
var jid = json.destroyrouterresponse.jobid;
args.response.success({
_custom: {
jobId: jid
}
});
}
});
},
notification: {
poll: pollAsyncJobResult
}
},
changeService: { changeService: {
label: 'Change service offering', label: 'Change service offering',
messages: { messages: {
@ -7320,6 +7350,7 @@
} }
else if (jsonObj.state == 'Stopped') { else if (jsonObj.state == 'Stopped') {
allowedActions.push("start"); allowedActions.push("start");
allowedActions.push("destroy");
allowedActions.push("changeService"); allowedActions.push("changeService");
} }
return allowedActions; return allowedActions;