cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [42/50] [abbrv] git commit: updated refs/heads/object_store to a0c3d28
Date Wed, 15 May 2013 07:42:25 GMT
CLOUDSTACK-768:ACLs on Private GATEWAY


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/10380cea
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/10380cea
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/10380cea

Branch: refs/heads/object_store
Commit: 10380cea41257608db45a7f6ad588d754ebe8811
Parents: b5bb9f2
Author: Pranav Saxena <pranav.saxena@citrix.com>
Authored: Tue May 14 22:47:53 2013 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Tue May 14 22:47:53 2013 +0530

----------------------------------------------------------------------
 ui/scripts/vpc.js |  138 +++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 130 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/10380cea/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 7f56f9b..1f01d47 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -723,9 +723,32 @@
               isBoolean:true,
               isChecked:false
 
-            }
+            },
+      
+             aclid:{
+              label:'ACL',
+              select:function(args){
+                $.ajax({
+                 url: createURL('listNetworkACLLists'),
+                 dataType: 'json',
+                 async: true,
+                 success: function(json) {
+                      var objs = json.listnetworkacllistsresponse.networkacllist;
+                      var items = [];
+                      $(objs).each(function() {
+                          if(this.name == "default_deny")
+                           items.unshift({id:this.id,description:this.name});
+                          else
+                          items.push({id: this.id, description: this.name});
+
+
+                           });
+                     args.response.success({data: items});
+                 }
+              });
 
-         
+               }
+             }
           }
         },
         action: function(args) {
@@ -745,7 +768,9 @@
               ipaddress: args.data.ipaddress,
               gateway: args.data.gateway,
               netmask: args.data.netmask,
-              vlan: args.data.vlan
+              vlan: args.data.vlan,
+              aclid:args.data.aclid
+
             },
             success: function(json) {
               var jid = json.createprivategatewayresponse.jobid;
@@ -834,11 +859,34 @@
               isBoolean:true,
               isChecked:false
 
-            }
+            },
 
-          }
+             aclid:{
+              label:'ACL',
+              select:function(args){
+                $.ajax({
+                 url: createURL('listNetworkACLLists'),
+                 dataType: 'json',
+                 async: true,
+                 success: function(json) {
+                      var objs = json.listnetworkacllistsresponse.networkacllist;
+                      var items = [];
+                      $(objs).each(function() {
+                          if(this.name == "default_deny")
+                           items.unshift({id:this.id,description:this.name});
+                          else
+                          items.push({id: this.id, description: this.name});
+
+
+                           });
+                     args.response.success({data: items});
+                 }
+              });
 
+               }
+             }
 
+          }
 
             },
             action:function(args){
@@ -851,15 +899,17 @@
               array1.push("&sourcenatsupported=false");
 
 
-                       $.ajax({
+           $.ajax({
             url: createURL('createPrivateGateway'+ array1.join("")),
             data: {
-                                                  physicalnetworkid: args.data.physicalnetworkid,
+              physicalnetworkid: args.data.physicalnetworkid,
               vpcid: args.context.vpc[0].id,
               ipaddress: args.data.ipaddress,
               gateway: args.data.gateway,
               netmask: args.data.netmask,
-              vlan: args.data.vlan
+              vlan: args.data.vlan,
+              aclid:args.data.aclid
+
             },
             success: function(json) {
               var jid = json.createprivategatewayresponse.jobid;
@@ -933,7 +983,77 @@
                   notification: {
                     poll: pollAsyncJobResult
                   }
+                },
+                 
+               replaceACL:{
+                  label:'Replace ACL',
+                  createForm:{
+                    title:'Replace ACL',
+                    label:'Replace ACL',
+                   fields:{
+                    aclid:{
+                 label:'ACL',
+                 select:function(args){
+                 $.ajax({
+                 url: createURL('listNetworkACLLists'),
+                 dataType: 'json',
+                 async: true,
+                 success: function(json) {
+                      var objs = json.listnetworkacllistsresponse.networkacllist;
+                      var items = [];
+                      $(objs).each(function() {
+
+                          items.push({id: this.id, description: this.name});
+                           });
+                     args.response.success({data: items});
+                       }
+                     });
+                    }
                 }
+              }
+             },
+           
+               action: function(args) {
+                    $.ajax({
+                      url: createURL("replaceNetworkACLList&gatewayid=" + args.context.vpcGateways[0].id
+ "&aclid=" + args.data.aclid ),
+                      dataType: "json",
+                      success: function(json) {
+                        var jid = json.replacenetworkacllistresponse.jobid;
+                        args.response.success(
+
+                          {_custom:
+                           {
+                             jobId: jid,
+                             getUpdatedItem: function(json) {
+                               var item = json.queryasyncjobresultresponse.jobresult.aclid;
+                               return {data:item};
+                             }
+                           }
+                          }
+
+                       )
+                      },
+
+                      error:function(json){
+
+                         args.response.error(parseXMLHttpResponse(json));
+                     }
+                    });
+                  },
+
+                   notification: {
+                  poll: pollAsyncJobResult
+                },
+
+                    messages: {
+                    confirm: function(args) {
+                      return 'Do you want to replace the ACL with a new one ?';
+                    },
+                    notification: function(args) {
+                      return 'ACL replaced';
+                    }
+                  }
+                 }
               },
               tabs: {
                 details: {
@@ -975,6 +1095,8 @@
                             var allowedActions = [];
                             if(isAdmin()) {
                               allowedActions.push("remove");
+                              allowedActions.push("replaceACL");
+
                             }
                             return allowedActions;
                           }


Mime
View raw message