cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [01/10] git commit: updated refs/heads/master to 6f9215c
Date Wed, 20 Jan 2016 13:18:32 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 26936cdb2 -> 6f9215cf3


CLOUDSTACK-9236: Load Balancing Health Check button displayed when non-NetScaler offering
is used

This button will be shown only when the load balancer is NetScaler.
Otherwise it is hidden.


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

Branch: refs/heads/master
Commit: 3787f4d92bd2b24143dec23dbe89edd242f8c3a6
Parents: 80703ca
Author: Nitin Kumar Maharana <nitin.maharana@gmail.com>
Authored: Thu Jan 14 12:25:22 2016 +0530
Committer: Nitin Kumar Maharana <nitin.maharana@gmail.com>
Committed: Thu Jan 14 12:25:22 2016 +0530

----------------------------------------------------------------------
 ui/scripts/network.js | 52 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3787f4d9/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index cdfbcaa..63ef014 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3620,7 +3620,37 @@
                                                     requireValidation: true,
                                                     buttonLabel: 'Configure',
                                                     action: cloudStack.uiCustom.healthCheck()
-
+                                                },
+                                                isHidden: function(args) {
+                                                    if (!('vpc' in args.context)) {  //From
Guest Network section
+                                                        var lbProviderIsNetscaler = false;
+                                                        $.ajax({
+                                                            url: createURL('listNetworkOfferings'),
+                                                            data: {
+                                                                id: args.context.networks[0].networkofferingid
+                                                            },
+                                                            async: false,
+                                                            success: function(json) {
+                                                                var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
+                                                                var services = networkOffering.service;
+                                                                lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
+                                                            }
+                                                        });
+                                                        if (lbProviderIsNetscaler == true)
{ //Health-Check is only supported on Netscaler (but not on any other provider)
+                                                            return false; //Show Health-Check
button
+                                                        } else {
+                                                            return 2; //Hide Health-Check
button (Both Header and Form)
+                                                        }
+                                                    } else { //From VPC section
+                                                        var lbProviderIsNetscaler;
+                                                        var services = args.context.vpc[0].service;
+                                                        lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
+                                                        if (lbProviderIsNetscaler == true)
{ //Health-Check is only supported on Netscaler (but not on any other provider)
+                                                            return false; //Show Health-Check
button
+                                                        } else {
+                                                            return 2; //Hide Health-Check
button (both Header and Form)
+                                                        }
+                                                    }
                                                 }
                                             },
 
@@ -6525,6 +6555,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