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/19 21:37:45 UTC

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

Repository: cloudstack
Updated Branches:
  refs/heads/4.7 c7ad1b608 -> 368bfc3e1


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/4.7
Commit: 3787f4d92bd2b24143dec23dbe89edd242f8c3a6
Parents: 80703ca
Author: Nitin Kumar Maharana <ni...@gmail.com>
Authored: Thu Jan 14 12:25:22 2016 +0530
Committer: Nitin Kumar Maharana <ni...@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;


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

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

CLOUDSTACK-9236: Load Balancing Health Check button displayed when non-NetScaler offering is usedLoad balancing health check option / button should only be displayed when a NetScaler based networking offering is being used.

If you try to use the health check option when NetScaler is not being used as the load balancing technology the UI throws an error stating that the health check option is not supported.

This button / option should be removed from the UI if NetScaler is not included in the network offering as customers will be confused.

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

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

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

Branch: refs/heads/4.7
Commit: 368bfc3e1b65c74dae0ebc37b3f02379b53b9ef4
Parents: c7ad1b6 3787f4d
Author: Remi Bergsma <gi...@remi.nl>
Authored: Tue Jan 19 21:36:31 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Tue Jan 19 21:36:31 2016 +0100

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


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