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 2016/01/20 22:18:15 UTC

[1/2] git commit: updated refs/heads/4.7 to c14183b

Repository: cloudstack
Updated Branches:
  refs/heads/4.7 c99f57fc9 -> c14183bd2


CLOUDSTACK-9235: Autoscale button is missing in VPC

In case of VPC, it checks the services available.
If LB is there, It checks the provider is Netscaler then it shows the button or hides it.


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

Branch: refs/heads/4.7
Commit: b02e9f00106a705e862cd859e021d21c9780da68
Parents: 80703ca
Author: Nitin Kumar Maharana <ni...@gmail.com>
Authored: Thu Jan 14 12:04:13 2016 +0530
Committer: Nitin Kumar Maharana <ni...@gmail.com>
Committed: Thu Jan 14 12:04:13 2016 +0530

----------------------------------------------------------------------
 ui/scripts/network.js | 49 +++++++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b02e9f00/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index cdfbcaa..e4a54e1 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3643,22 +3643,7 @@
                                                             success: function(json) {
                                                                 var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
                                                                 var services = networkOffering.service;
-                                                                if (services != null) {
-                                                                    for (var i = 0; i < services.length; i++) {
-                                                                        if (services[i].name == 'Lb') {
-                                                                            var providers = services[i].provider;
-                                                                            if (providers != null) {
-                                                                                for (var k = 0; k < providers.length; k++) {
-                                                                                    if (providers[k].name == 'Netscaler') {
-                                                                                        lbProviderIsNetscaler = true;
-                                                                                        break;
-                                                                                    }
-                                                                                }
-                                                                            }
-                                                                            break;
-                                                                        }
-                                                                    }
-                                                                }
+                                                                lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
                                                             }
                                                         });
                                                         if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
@@ -3667,8 +3652,16 @@
                                                             return 2; //hide Autoscale button (both header and form)
                                                         }
                                                     } else { //from VPC section
-                                                        //VPC doesn't support autoscale
-                                                        return 2;
+                                                        var lbProviderIsNetscaler;
+                                                        var services = args.context.vpc[0].service;
+
+                                                        lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
+
+                                                        if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
+                                                            return false; //show AutoScale button
+                                                        } else {
+                                                            return 2; //hide Autoscale button (both header and form)
+                                                        }
                                                     }
                                                 }
                                             },
@@ -6525,6 +6518,26 @@
         }
     };
 
+    function checkIfNetScalerProviderIsEnabled(services) {
+        if (services != null) {
+            for (var i = 0; i < services.length; i++) {
+                if (services[i].name == 'Lb') {
+                    var providers = services[i].provider;
+                    if (providers != null) {
+                        for (var k = 0; k < providers.length; k++) {
+                            if (providers[k].name == 'Netscaler') {
+                                return true;
+                            }
+                        }
+                    }
+                    return false;
+                }
+            }
+        }
+
+        return false;
+    }
+
     function getExtaPropertiesForIpObj(ipObj, args) {
         if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page *****
             var services = args.context.networks[0].service;


[2/2] git commit: updated refs/heads/4.7 to c14183b

Posted by re...@apache.org.
Merge pull request #1337 from nitin-maharana/CloudStack-Nitin20_4.7

CLOUDSTACK-9235: Autoscale button is missing in VPCAutoscale button is missing. This should not be the case since we are able to add NS as the external LB provider in VPC.

Steps:
=====
1. Create a VPC offering with NS as the external LB provider
2. Create a VPC and configure the public tier with the above offering
3. Acquire an IP address and try to configure Load Balancing rule

Result:
======
Autoscale option is not visible at all for the LB.

Expected Result:
=============
Autoscale option should be available and should work exactly like the way it works for a normal isolated network with NS. If we choose NS as service provider for LB, autoscale should also be visible. If VR is chosen, only then we should not display autoscale.

Fix:
===
In case of VPC, it checks the services available.
If LB is there, It checks the provider is Netscaler then it shows the button or hides it.

* pr/1337:
  CLOUDSTACK-9235: Autoscale button is missing in VPC

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/c14183bd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c14183bd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c14183bd

Branch: refs/heads/4.7
Commit: c14183bd25f6edfbda215533d8fb82f0337626d7
Parents: c99f57f b02e9f0
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Jan 20 22:17:54 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Wed Jan 20 22:17:54 2016 +0100

----------------------------------------------------------------------
 ui/scripts/network.js | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


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