You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/10/09 02:43:21 UTC

git commit: AMBARI-3478: After setting up Nagios HTTPS, Nagios links on ambari-web alert section should redirect to https protocol.(jaimin)

Updated Branches:
  refs/heads/branch-1.4.1 217153255 -> 4987d4626


AMBARI-3478: After setting up Nagios HTTPS, Nagios links on ambari-web alert section should redirect to https protocol.(jaimin)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/4987d462
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/4987d462
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/4987d462

Branch: refs/heads/branch-1.4.1
Commit: 4987d4626d25ae41532dc3a0e40c7fe4a5daada2
Parents: 2171532
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Oct 8 17:42:29 2013 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Oct 8 17:42:29 2013 -0700

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    | 30 ++++++++++++++++----
 1 file changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4987d462/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 766d343..0a2d94f 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -22,6 +22,7 @@ App.ClusterController = Em.Controller.extend({
   name:'clusterController',
   cluster:null,
   isLoaded:false,
+  ambariProperties: null,
   clusterDataLoadedPercent: 'width:0', // 0 to 1
   /**
    * Whether we need to update statuses automatically or not
@@ -121,14 +122,14 @@ App.ClusterController = Em.Controller.extend({
               if (host) {
                 hostName = host.get('publicHostName');
               }
-              return "http://" + (App.singleNodeInstall ? App.singleNodeAlias + ":42080" : hostName) + "/ganglia";
+              return this.get('gangliaWebProtocol') + "://" + (App.singleNodeInstall ? App.singleNodeAlias + ":42080" : hostName) + "/ganglia";
             }
           }
         }
       }
       return null;
     }
-  }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),
+  }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts','gangliaWebProtocol'),
 
   /**
    * Provides the URL to use for NAGIOS server. This URL
@@ -155,14 +156,32 @@ App.ClusterController = Em.Controller.extend({
               if (host) {
                 hostName = host.get('publicHostName');
               }
-              return "http://" + (App.singleNodeInstall ? App.singleNodeAlias + ":42080" : hostName) + "/nagios";
+              return this.get('nagiosWebProtocol') + "://" + (App.singleNodeInstall ? App.singleNodeAlias + ":42080" : hostName) + "/nagios";
             }
           }
         }
       }
       return null;
     }
-  }.property('App.router.updateController.isUpdated', 'dataLoadList.services', 'dataLoadList.hosts'),
+  }.property('App.router.updateController.isUpdated', 'dataLoadList.services', 'dataLoadList.hosts','nagiosWebProtocol'),
+
+  nagiosWebProtocol: function () {
+    var properties = this.get('ambariProperties');
+    if (properties && properties.hasOwnProperty('nagios.https') && properties['nagios.https']) {
+      return "https";
+    } else {
+      return "http";
+    }
+  }.property('ambariProperties'),
+
+  gangliaWebProtocol: function () {
+    var properties = this.get('ambariProperties');
+    if (properties && properties.hasOwnProperty('ganglia.https') && properties['ganglia.https']) {
+      return "https";
+    } else {
+      return "http";
+    }
+  }.property('ambariProperties'),
 
   isNagiosInstalled:function () {
     return !!App.Service.find().findProperty('serviceName', 'NAGIOS');
@@ -284,6 +303,7 @@ App.ClusterController = Em.Controller.extend({
    */
   loadClusterData:function () {
     var self = this;
+    this.loadAmbariProperties();
     if (!this.get('clusterName')) {
       return;
     }
@@ -366,10 +386,8 @@ App.ClusterController = Em.Controller.extend({
     this.loadAlerts(function(){
         self.updateLoadStatus('alerts');
     });
-    this.loadAmbariProperties();
   },
 
-  ambariProperties: null,
 
   loadAmbariProperties: function() {
     App.ajax.send({