From 45f9701c6375d007cb0173514c67d4f5f7519b69 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 11 Jan 2012 15:12:22 -0800 Subject: [PATCH] bug 12910: cloudstack 3.0 new UI - router page - add "Destroy" action. --- ui/scripts/system.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index c1f8d31c25a..61e9d6ddb92 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1581,7 +1581,37 @@ 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: { label: 'Change service offering', messages: { @@ -7320,6 +7350,7 @@ } else if (jsonObj.state == 'Stopped') { allowedActions.push("start"); + allowedActions.push("destroy"); allowedActions.push("changeService"); } return allowedActions;