Updated Branches: refs/heads/trunk 55c7e46e3 -> b0c07e197
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/b0c07e19 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/b0c07e19 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/b0c07e19 Branch: refs/heads/trunk Commit: b0c07e197839c35c1fc7178e19e30207c361c2f3 Parents: 55c7e46 Author: Jaimin Jetly <[email protected]> Authored: Tue Oct 8 17:42:29 2013 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Tue Oct 8 17:43:56 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/b0c07e19/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({
