cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/4.7 to c14183b
Date Wed, 20 Jan 2016 21:18:15 GMT
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 <nitin.maharana@gmail.com>
Authored: Thu Jan 14 12:04:13 2016 +0530
Committer: Nitin Kumar Maharana <nitin.maharana@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;


Mime
View raw message