CS-15720:Site 2 Site VPN:Front End development for adding a vpn conenction from vpn connection page

This commit is contained in:
Pranav Saxena 2012-07-31 03:46:45 +05:30
parent f763f53c2d
commit 5f2bbf0e2a

View File

@ -892,7 +892,74 @@
}
});
},
actions:{
add: {
label:'add VPN connection',
messages: {
notification:function(args) {
return 'add VPN connection';
},
createForm: {
title:'add VPN connection',
fields: {
zoneid: {
label:'Zone',
validation:{required:true},
select: function(args) {
$.ajax({
url: createURL('listZones'),
data: {
available: true
},
success: function(json) {
var zones = json.listzonesresponse.zone;
args.response.success({
data: $.map(zones, function(zone) {
return {
id: zone.id,
description: zone.name
};
})
});
}
});
}
},
vpcid:{
label:'VPC',
validation:{ required:true},
dependsOn: 'zoneid',
select: function(args) {
$.ajax({
url: createURL('listVPCs'),
data: {
zoneid: args.zoneid,
listAll: true
},
success: function(json) {
var items = json.listvpcsresponse.vpc;
var data;
if(items != null && items.length > 0) {
data = $.map(items, function(item) {
return {
id: item.id,
description: item.name
}
});
}
args.response.success({ data: data });
}
});
}
}
}
},
action:function(args) {
// Code for passing the customer gateway ID and VPN id
// Server side Integration code
}
}
},
detailView: {
name: 'label.details',
tabs: {