From 7ca488334f4fd48c150b31b73ad5be34052a19c8 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Sat, 11 May 2013 02:50:16 +0530 Subject: [PATCH] CLOUDSTACK-1828:NAT on private gateway UI support --- ui/scripts/ui-custom/vpc.js | 1 + ui/scripts/vpc.js | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 2bd26b11f1a..4edccf10211 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -152,6 +152,7 @@ addAction.action({ data: data, + $form:args.$form, context: gateways.context, response: { success: function(args) { diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index dc26265c232..17cf42a5e91 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -717,12 +717,28 @@ netmask: { label: 'label.netmask', validation: { required: true }, docID: 'helpVPCGatewayNetmask' + }, + sourceNat:{ + label:'Source NAT', + isBoolean:true, + isChecked:false + } + + } }, action: function(args) { + var array1=[]; + if(args.$form.find('.form-item[rel=sourceNat]').find('input[type=checkbox]').is(':Checked')== true) { + array1.push("&sourcenatsupported=true"); + } + else + array1.push("&sourcenatsupported=false"); + + $.ajax({ - url: createURL('createPrivateGateway'), + url: createURL('createPrivateGateway'+ array1.join("")), data: { physicalnetworkid: args.data.physicalnetworkid, vpcid: args.context.vpc[0].id, @@ -811,15 +827,32 @@ netmask: { label: 'label.netmask', validation: { required: true }, docID: 'helpVPCGatewayNetmask' + }, + + sourceNat:{ + label:'Source NAT', + isBoolean:true, + isChecked:false + } + } }, action:function(args){ + + var array1=[]; + if(args.$form.find('.form-item[rel=sourceNat]').find('input[type=checkbox]').is(':Checked')== true) { + array1.push("&sourcenatsupported=true"); + } + else + array1.push("&sourcenatsupported=false"); + + $.ajax({ - url: createURL('createPrivateGateway'), + url: createURL('createPrivateGateway'+ array1.join("")), data: { physicalnetworkid: args.data.physicalnetworkid, vpcid: args.context.vpc[0].id,