You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/07/09 00:53:16 UTC

[1/3] git commit: updated refs/heads/master to 9e5449c

Updated Branches:
  refs/heads/master 833c83d7f -> 9e5449c34


Detail view: Fix context not being refreshed on perform action


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

Branch: refs/heads/master
Commit: 9e5449c34745ddfd63ba46719aed63f6f9a995fd
Parents: a876a57
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jul 8 15:52:56 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jul 8 15:53:14 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/detailView.js | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e5449c3/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 356d9f2..0bccef5 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -88,9 +88,17 @@
 
       var updateTabContent = function(newData) {
         var $detailViewElems = $detailView.find('ul.ui-tabs-nav, .detail-group').remove();
+        var viewArgs = $detailView.data('view-args');
+        var context =  viewArgs.context;
+        var activeContextItem = viewArgs.section ? context[viewArgs.section][0] : null;
+        
         $detailView.tabs('destroy');
         $detailView.data('view-args').jsonObj = newData;
 
+        if (activeContextItem) {
+          $.extend(activeContextItem, newData);
+        }
+
         makeTabs(
           $detailView,
           $detailView.data('view-args').tabs,


[2/3] git commit: updated refs/heads/master to 9e5449c

Posted by bf...@apache.org.
CLOUDSTACK-3337: Don't show current ACL list in dropdown


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

Branch: refs/heads/master
Commit: a876a575dd75e5d444fdcac9f26bd2437339f927
Parents: 0fc47c2
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jul 8 15:23:15 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jul 8 15:53:14 2013 -0700

----------------------------------------------------------------------
 ui/modules/vpc/vpc.js |  1 +
 ui/scripts/vpc.js     | 32 +++++++++++++++++++-------------
 2 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a876a575/ui/modules/vpc/vpc.js
----------------------------------------------------------------------
diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js
index 981d612..fb7320d 100644
--- a/ui/modules/vpc/vpc.js
+++ b/ui/modules/vpc/vpc.js
@@ -89,6 +89,7 @@
           complete: function($panel) {
             var $detailView = $('<div>').detailView(
               $.extend(true, {}, cloudStack.vpc.tiers.detailView, {
+                section: 'networks',
                 $browser: $browser,
                 context: context,
                 onActionComplete: function() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a876a575/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 40a375c..b93328f 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -2892,9 +2892,15 @@
                       success: function(json) {
                         var objs = json.listnetworkacllistsresponse.networkacllist;
                         var items = [];
+                        
                         $(objs).each(function() {
-
+                          if (this.id == args.context.networks[0].aclid) {
+                            return true;
+                          }
+                          
                           items.push({id: this.id, description: this.name});
+
+                          return true;
                         });
                         args.response.success({data: items});
                       }
@@ -2905,23 +2911,23 @@
             },
             action: function(args) {
               $.ajax({
-                url: createURL("replaceNetworkACLList&networkid=" + args.context.networks[0].id + "&aclid=" + args.data.aclid ),
+                url: createURL("replaceNetworkACLList&networkid=" + args.context.networks[0].id + "&aclid=" + args.data.aclid),
                 dataType: "json",
                 success: function(json) {
                   var jid = json.replacenetworkacllistresponse.jobid;
-                  args.response.success(
+                  
+                  args.response.success({
+                    _custom: {
+                      jobId: jid,
+                      getUpdatedItem: function(json) {
+                        var network = args.context.networks[0];
 
-                    {_custom: 
-                     {
-                       jobId: jid,
-                       getUpdatedItem: function(json) {
-                         var item = json.queryasyncjobresultresponse.jobresult.aclid;
-                         return {data: item};
-                       }
-                     }
+                        network.aclid = args.data.aclid;
+                        
+                        return { aclid: args.data.aclid };
+                      }
                     }
-
-                  )
+                  });
                 },
 
                 error: function(json){


[3/3] git commit: updated refs/heads/master to 9e5449c

Posted by bf...@apache.org.
VPC JS: Code cleanup


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

Branch: refs/heads/master
Commit: 0fc47c215f674b028ebf7071bffce9c983687f90
Parents: 833c83d
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jul 8 14:28:07 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jul 8 15:53:14 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 197 +++++++++++++++++++++++++------------------------
 1 file changed, 99 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0fc47c21/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index cf2d9c2..40a375c 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -1971,35 +1971,37 @@
                   }
                 },
                  
-               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});
-                       }
-                     });
+                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) {
+                  },
+                  
+                  action: function(args) {
                     $.ajax({
                       url: createURL("replaceNetworkACLList&gatewayid=" + args.context.vpcGateways[0].id + "&aclid=" + args.data.aclid ),
                       dataType: "json",
@@ -2007,31 +2009,31 @@
                         var jid = json.replacenetworkacllistresponse.jobid;
                         args.response.success(
 
-                          {_custom:
+                          {_custom: 
                            {
                              jobId: jid,
                              getUpdatedItem: function(json) {
                                var item = json.queryasyncjobresultresponse.jobresult.aclid;
-                               return {data:item};
+                               return {data: item};
                              }
                            }
                           }
 
-                       )
+                        )
                       },
 
-                      error:function(json){
+                      error: function(json){
 
-                         args.response.error(parseXMLHttpResponse(json));
-                     }
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
                     });
                   },
 
-                   notification: {
-                  poll: pollAsyncJobResult
-                },
+                  notification: {
+                    poll: pollAsyncJobResult
+                  },
 
-                    messages: {
+                  messages: {
                     confirm: function(args) {
                       return 'Do you want to replace the ACL with a new one ?';
                     },
@@ -2039,7 +2041,7 @@
                       return 'ACL replaced';
                     }
                   }
-                 }
+                }
               },
               tabs: {
                 details: {
@@ -2874,74 +2876,73 @@
             }
           },
 
-          replaceacllist:{
-
-             label:'Replace ACL List',
-              createForm:{
-                    title:'Replace ACL List',
-                    label:'Replace ACL List',
-                   fields:{
-                    aclid:{
-                 label:'ACL',
-                 select:function(args){
-                 $.ajax({
-                 url: createURL('listNetworkACLLists&vpcid=' + args.context.vpc[0].id),
-                 dataType: 'json',
-                 async: true,
-                 success: function(json) {
-                      var objs = json.listnetworkacllistsresponse.networkacllist;
-                      var items = [];
-                      $(objs).each(function() {
+          replaceacllist: {
+            label: 'Replace ACL List',
+            createForm: {
+              title: 'Replace ACL List',
+              label: 'Replace ACL List',
+              fields: {
+                aclid: {
+                  label: 'ACL',
+                  select: function(args){
+                    $.ajax({
+                      url: createURL('listNetworkACLLists&vpcid=' + args.context.vpc[0].id),
+                      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});
-                       }
-                     });
-                    }
+                        });
+                        args.response.success({data: items});
+                      }
+                    });
+                  }
                 }
               }
-             },
-              action: function(args) {
-                    $.ajax({
-                      url: createURL("replaceNetworkACLList&networkid=" + args.context.networks[0].id + "&aclid=" + args.data.aclid ),
-                      dataType: "json",
-                      success: function(json) {
-                        var jid = json.replacenetworkacllistresponse.jobid;
-                        args.response.success(
+            },
+            action: function(args) {
+              $.ajax({
+                url: createURL("replaceNetworkACLList&networkid=" + args.context.networks[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};
-                             }
-                           }
-                          }
+                    {_custom: 
+                     {
+                       jobId: jid,
+                       getUpdatedItem: function(json) {
+                         var item = json.queryasyncjobresultresponse.jobresult.aclid;
+                         return {data: item};
+                       }
+                     }
+                    }
 
-                       )
-                      },
+                  )
+                },
 
-                      error:function(json){
+                error: function(json){
 
-                         args.response.error(parseXMLHttpResponse(json));
-                     }
-                    });
-                  },
-                  notification: {
-                  poll: pollAsyncJobResult
-                },
+                  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';
-                    }
-                  }
-             } 
+            messages: {
+              confirm: function(args) {
+                return 'Do you want to replace the ACL with a new one ?';
+              },
+              notification: function(args) {
+                return 'ACL replaced';
+              }
+            }
+          }
         },
 
         tabFilter: function(args) {