File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 892892 }
893893 } ) ;
894894 } ,
895-
895+ actions :{
896+ add : {
897+ label :'add VPN connection' ,
898+ messages : {
899+ notification :function ( args ) {
900+ return 'add VPN connection' ;
901+ } ,
902+ createForm : {
903+ title :'add VPN connection' ,
904+ fields : {
905+ zoneid : {
906+ label :'Zone' ,
907+ validation :{ required :true } ,
908+ select : function ( args ) {
909+ $ . ajax ( {
910+ url : createURL ( 'listZones' ) ,
911+ data : {
912+ available : true
913+ } ,
914+ success : function ( json ) {
915+ var zones = json . listzonesresponse . zone ;
916+ args . response . success ( {
917+ data : $ . map ( zones , function ( zone ) {
918+ return {
919+ id : zone . id ,
920+ description : zone . name
921+ } ;
922+ } )
923+ } ) ;
924+ }
925+ } ) ;
926+ }
927+ } ,
928+ vpcid :{
929+ label :'VPC' ,
930+ validation :{ required :true } ,
931+ dependsOn : 'zoneid' ,
932+ select : function ( args ) {
933+ $ . ajax ( {
934+ url : createURL ( 'listVPCs' ) ,
935+ data : {
936+ zoneid : args . zoneid ,
937+ listAll : true
938+ } ,
939+ success : function ( json ) {
940+ var items = json . listvpcsresponse . vpc ;
941+ var data ;
942+ if ( items != null && items . length > 0 ) {
943+ data = $ . map ( items , function ( item ) {
944+ return {
945+ id : item . id ,
946+ description : item . name
947+ }
948+ } ) ;
949+ }
950+ args . response . success ( { data : data } ) ;
951+ }
952+ } ) ;
953+ }
954+ }
955+ }
956+ } ,
957+ action :function ( args ) {
958+ // Code for passing the customer gateway ID and VPN id
959+ // Server side Integration code
960+ }
961+ }
962+ } ,
896963 detailView : {
897964 name : 'label.details' ,
898965 tabs : {
You can’t perform that action at this time.
0 commit comments