You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/11/02 20:05:32 UTC

[1/2] git commit: updated refs/heads/master to 8db10be

Repository: cloudstack
Updated Branches:
  refs/heads/master 0b4cc5de8 -> 8db10be09


CLOUDSTACK-8919: Slow UI response while loading the list of networks in network tab.

Instead of searching for each network, now it is searching for each zone.
For basic zone, it will show the security group directly because by default securitygroupsenabled is true.
For advanced zone, check the securitygroupsenabled option in each zone. If any one has value true, then show.


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

Branch: refs/heads/master
Commit: e8c4b2b44bb4951714d414a1f8bb4d4cf33fc883
Parents: 930ef8d
Author: Nitin Kumar Maharana <ni...@citrix.com>
Authored: Tue Sep 29 00:09:15 2015 +0530
Committer: Nitin Kumar Maharana <ni...@gmail.com>
Committed: Fri Oct 30 15:11:02 2015 +0530

----------------------------------------------------------------------
 ui/scripts/network.js | 43 ++++++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e8c4b2b4/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 110bc4b..5d3ef9b 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -376,7 +376,9 @@
         sectionSelect: {
             preFilter: function(args) {
                 var sectionsToShow = ['networks'];
+                var securityGroupsEnabledFound = false; //Until we found a zone where securitygroupsenabled is true.
 
+                //This call to show VPC and VPN Customer Gateway sections, if zone is advanced.
                 $.ajax({
                     url: createURL('listZones'),
                     data: {
@@ -384,29 +386,40 @@
                     },
                     async: false,
                     success: function(json) {
-                        advZoneObjs = json.listzonesresponse.zone;
+                        advZoneObjs = json.listzonesresponse ? json.listzonesresponse.zone : null;
                         if (advZoneObjs != null && advZoneObjs.length > 0) {
                             sectionsToShow.push('vpc');
                             sectionsToShow.push('vpnCustomerGateway');
+
+                            //At the same time check if any advanced zone has securitygroupsenabled is true.
+                            //If so, show Security Group section.
+                            for (var i = 0; (i < advZoneObjs.length) && !securityGroupsEnabledFound; i++) {
+                                if (advZoneObjs[i].securitygroupsenabled) {
+                                    securityGroupsEnabledFound = true;
+                                    sectionsToShow.push('securityGroups');
+                                }
+                            }
                         }
                     }
                 });
 
-                $.ajax({
-                    url: createURL('listNetworks', {
-                        ignoreProject: true
-                    }),
-                    data: {
-                        supportedServices: 'SecurityGroup',
-                        listAll: true
-                    },
-                    async: false,
-                    success: function(json) {
-                        if (json.listnetworksresponse.network != null && json.listnetworksresponse.network.length > 0) {
-                            sectionsToShow.push('securityGroups');
+                //If we didn't find any advanced zone whose securitygroupsenabled is true.
+                //Search in all Basic zones.
+                if (!securityGroupsEnabledFound) {
+                    $.ajax({
+                        url: createURL('listZones'),
+                        data: {
+                            networktype: 'Basic'
+                        },
+                        async: false,
+                        success: function(json) {
+                            var basicZoneObjs = json.listzonesresponse ? json.listzonesresponse.zone : null;
+                            if (basicZoneObjs != null && basicZoneObjs.length > 0) {
+                                sectionsToShow.push('securityGroups');
+                            }
                         }
-                    }
-                });
+                    });
+                }
 
                 return sectionsToShow;
             },


[2/2] git commit: updated refs/heads/master to 8db10be

Posted by re...@apache.org.
Merge pull request #897 from nitin-maharana/CloudStack-Nitin10

CLOUDSTACK-8919: Slow UI response while loading the list of networks in network tab.Instead of searching for each network, now it is searching for each zone.
For basic zone, it will show the security group directly because by default securitygroupsenabled is true.
For advanced zone, check the securitygroupsenabled option in each zone. If any one has value true, then show.

* pr/897:
  CLOUDSTACK-8919: Slow UI response while loading the list of networks in network tab.

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/master
Commit: 8db10be093343ce714dc7374d6afa90ce1ef5d63
Parents: 0b4cc5d e8c4b2b
Author: Remi Bergsma <gi...@remi.nl>
Authored: Mon Nov 2 20:04:51 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Mon Nov 2 20:04:51 2015 +0100

----------------------------------------------------------------------
 ui/scripts/network.js | 43 ++++++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8db10be0/ui/scripts/network.js
----------------------------------------------------------------------