From 76b8407b696173a7cd0b4c9f732193fb139a1cf2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 11 Jul 2012 15:15:56 -0700 Subject: [PATCH] cloudstack 3.0 UI - VPC - gateways - implement Remove Gateway action. --- ui/scripts/vpc.js | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index f42c6513c27..0253b606f5d 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -490,6 +490,39 @@ }, detailView: { name: 'Gateway details', + actions: { + remove: { + label: 'delete gateway', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete the gateway'; + }, + notification: function(args) { + return 'delete gateway'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deletePrivateGateway&id=" + args.context.vpcGateways[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deleteprivategatewayresponse.jobid; + args.response.success( + {_custom: + { + jobId: jid + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, tabs: { details: { title: 'label.details', @@ -500,7 +533,8 @@ { gateway: { label: 'label.gateway' }, netmask: { label: 'label.netmask'}, - vlan: { label: 'label.vlan' }, + vlan: { label: 'label.vlan' }, + state: { label: 'label.state' }, id: { label: 'label.id' }, zonename: { label: 'label.zone' }, domain: { label: 'label.domain' }, @@ -562,8 +596,7 @@ actions: { destroy: { label: 'Remove static route', - action: function(args) { - //debugger; + action: function(args) { $.ajax({ url: createURL('deleteStaticRoute'), data: {