Skip to content

Commit 7ca4883

Browse files
committed
CLOUDSTACK-1828:NAT on private gateway UI support
1 parent b7f10bf commit 7ca4883

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

ui/scripts/ui-custom/vpc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152

153153
addAction.action({
154154
data: data,
155+
$form:args.$form,
155156
context: gateways.context,
156157
response: {
157158
success: function(args) {

ui/scripts/vpc.js

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,12 +717,28 @@
717717
netmask: {
718718
label: 'label.netmask', validation: { required: true },
719719
docID: 'helpVPCGatewayNetmask'
720+
},
721+
sourceNat:{
722+
label:'Source NAT',
723+
isBoolean:true,
724+
isChecked:false
725+
720726
}
727+
728+
721729
}
722730
},
723731
action: function(args) {
732+
var array1=[];
733+
if(args.$form.find('.form-item[rel=sourceNat]').find('input[type=checkbox]').is(':Checked')== true) {
734+
array1.push("&sourcenatsupported=true");
735+
}
736+
else
737+
array1.push("&sourcenatsupported=false");
738+
739+
724740
$.ajax({
725-
url: createURL('createPrivateGateway'),
741+
url: createURL('createPrivateGateway'+ array1.join("")),
726742
data: {
727743
physicalnetworkid: args.data.physicalnetworkid,
728744
vpcid: args.context.vpc[0].id,
@@ -811,15 +827,32 @@
811827
netmask: {
812828
label: 'label.netmask', validation: { required: true },
813829
docID: 'helpVPCGatewayNetmask'
830+
},
831+
832+
sourceNat:{
833+
label:'Source NAT',
834+
isBoolean:true,
835+
isChecked:false
836+
814837
}
838+
815839
}
816840

817841

818842

819843
},
820844
action:function(args){
845+
846+
var array1=[];
847+
if(args.$form.find('.form-item[rel=sourceNat]').find('input[type=checkbox]').is(':Checked')== true) {
848+
array1.push("&sourcenatsupported=true");
849+
}
850+
else
851+
array1.push("&sourcenatsupported=false");
852+
853+
821854
$.ajax({
822-
url: createURL('createPrivateGateway'),
855+
url: createURL('createPrivateGateway'+ array1.join("")),
823856
data: {
824857
physicalnetworkid: args.data.physicalnetworkid,
825858
vpcid: args.context.vpc[0].id,

0 commit comments

Comments
 (0)