diff options
author | Yusaku Sako <yusaku@apache.org> | 2012-12-09 14:28:13 +0000 |
---|---|---|
committer | Yusaku Sako <yusaku@apache.org> | 2012-12-09 14:28:13 +0000 |
commit | 762191fe315b95f9c7a6626ad5c1ab425e156649 (patch) | |
tree | dcc543bd20edcce8e3c19ab75194fa15f740c9cd /ambari-web | |
parent | d9376e87ca32940e03ea57ddb74c0dcd1b613d0c (diff) |
AMBARI-1033. Nagios and Ganglia links should use public host names in URLs. (Srimanth Gunturi via yusaku)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418973 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ambari-web')
-rw-r--r-- | ambari-web/app/controllers/global/cluster_controller.js | 14 | ||||
-rw-r--r-- | ambari-web/app/mappers/hosts_mapper.js | 1 | ||||
-rw-r--r-- | ambari-web/app/models/host.js | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index a844c4bf6e..a80c6fee81 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -82,7 +82,7 @@ App.ClusterController = Em.Controller.extend({ * * If null is returned, it means GANGLIA service is not installed. */ - gangliaUrl:function () { + gangliaUrl: function () { if (App.testMode) { return 'http://gangliaserver/ganglia/?t=yes'; } else { @@ -96,6 +96,10 @@ App.ClusterController = Em.Controller.extend({ if (gangliaSvcComponent) { var hostName = gangliaSvcComponent.get('host.hostName'); if (hostName) { + var host = App.Host.find(hostName); + if (host) { + hostName = host.get('publicHostName'); + } return "http://" + hostName + "/ganglia"; } } @@ -103,7 +107,7 @@ App.ClusterController = Em.Controller.extend({ } return null; } - }.property('App.router.updateController.isUpdated'), + }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'), /** * Provides the URL to use for NAGIOS server. This URL @@ -126,6 +130,10 @@ App.ClusterController = Em.Controller.extend({ if (nagiosSvcComponent) { var hostName = nagiosSvcComponent.get('host.hostName'); if (hostName) { + var host = App.Host.find(hostName); + if (host) { + hostName = host.get('publicHostName'); + } return "http://" + hostName + "/nagios"; } } @@ -133,7 +141,7 @@ App.ClusterController = Em.Controller.extend({ } return null; } - }.property('App.router.updateController.isUpdated'), + }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'), isNagiosInstalled:function () { if (App.testMode) { diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index 850620584d..8cba70c463 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/ambari-web/app/mappers/hosts_mapper.js @@ -20,6 +20,7 @@ App.hostsMapper = App.QuickDataMapper.create({ config: { id: 'Hosts.host_name', host_name: 'Hosts.host_name', + public_host_name: 'Hosts.public_host_name', cluster_id: 'Hosts.cluster_name',// 1 components_key: 'host_components', components_type: 'array', diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js index 60393a4475..c5c6e92bd5 100644 --- a/ambari-web/app/models/host.js +++ b/ambari-web/app/models/host.js @@ -22,6 +22,7 @@ var misc = require('utils/misc'); App.Host = DS.Model.extend({ hostName: DS.attr('string'), + publicHostName: DS.attr('string'), cluster: DS.belongsTo('App.Cluster'), components: DS.hasMany('App.Component'), hostComponents: DS.hasMany('App.HostComponent'), |