You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/12/08 18:11:45 UTC

ambari git commit: AMBARI-14260. Custom public hostnames don't work for MapReduce2 quick links (srimanth)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 ce859109c -> 830472a87


AMBARI-14260. Custom public hostnames don't work for MapReduce2 quick links (srimanth)


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

Branch: refs/heads/branch-2.2
Commit: 830472a873c537db83733a9d81bc87b932a89a8a
Parents: ce85910
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Mon Dec 7 18:54:08 2015 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Tue Dec 8 09:10:37 2015 -0800

----------------------------------------------------------------------
 ambari-web/app/views/common/quick_view_link_view.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/830472a8/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index c3eb6a9..57f60bc 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -151,7 +151,16 @@ App.QuickViewLinks = Em.View.extend({
             item.set('url', item.get('template').fmt(protocol, hosts[0], port, App.router.get('loginName')));
           } else if (item.get('service_id') === 'MAPREDUCE2') {
             siteConfigs = self.get('configProperties').findProperty('type', item.get('site')).properties;
-            item.set('url', item.get('template').fmt(protocol, siteConfigs[item.get(protocol + '_config')]));
+            var hostPortConfigValue = siteConfigs[item.get(protocol + '_config')];
+            if (hostPortConfigValue != null) {
+              var hostPortValue = hostPortConfigValue.match(new RegExp("([\\w\\d.-]*):(\\d+)"));
+              var hostObj = response.items.findProperty('Hosts.host_name', hostPortValue[1]);
+              if (hostObj != null) {
+                var publicHostValue = hostObj.Hosts.public_host_name;
+                hostPortConfigValue = "%@:%@".fmt(publicHostValue, hostPortValue[2])
+              }
+            }
+            item.set('url', item.get('template').fmt(protocol, hostPortConfigValue));
           } else if (item.get('service_id') === 'RANGER') {
             siteConfigs = self.get('configProperties').findProperty('type', 'admin-properties').properties;
             if (siteConfigs['policymgr_external_url']) {