Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 504A32004A1 for ; Thu, 10 Aug 2017 08:23:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4EBE316AB3C; Thu, 10 Aug 2017 06:23:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93FA516AB38 for ; Thu, 10 Aug 2017 08:23:52 +0200 (CEST) Received: (qmail 9523 invoked by uid 500); 10 Aug 2017 06:23:51 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 9514 invoked by uid 99); 10 Aug 2017 06:23:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2017 06:23:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BC635E96E8; Thu, 10 Aug 2017 06:23:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunilg@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-6631. Refactor loader.js in new Yarn UI. Contributed by Akhil P B. Date: Thu, 10 Aug 2017 06:23:50 +0000 (UTC) archived-at: Thu, 10 Aug 2017 06:23:53 -0000 Repository: hadoop Updated Branches: refs/heads/trunk ac7d0604b -> 8d953c235 YARN-6631. Refactor loader.js in new Yarn UI. Contributed by Akhil P B. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8d953c23 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8d953c23 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8d953c23 Branch: refs/heads/trunk Commit: 8d953c2359c5b12cf5b1f3c14be3ff5bb74242d0 Parents: ac7d060 Author: Sunil G Authored: Thu Aug 10 11:53:26 2017 +0530 Committer: Sunil G Committed: Thu Aug 10 11:53:26 2017 +0530 ---------------------------------------------------------------------- .../src/main/webapp/app/initializers/loader.js | 42 +++++++++----------- 1 file changed, 19 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d953c23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js index aa8fb07..55f6e1b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js @@ -20,25 +20,27 @@ import Ember from 'ember'; -function getTimeLineURL() { - return '/conf?name=yarn.timeline-service.webapp.address'; +function getTimeLineURL(rmhost) { + var url = window.location.protocol + '//' + + (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + rmhost; + + url += '/conf?name=yarn.timeline-service.webapp.address'; + Ember.Logger.log("Get Timeline Address URL: " + url); + return url; } function updateConfigs(application) { var hostname = window.location.hostname; - var rmhost = hostname + - (window.location.port ? ':' + window.location.port: ''); - - Ember.Logger.log("RM Address:" + rmhost); + var rmhost = hostname + (window.location.port ? ':' + window.location.port: ''); if(!ENV.hosts.rmWebAddress) { - ENV = { - hosts: { - rmWebAddress: rmhost, - }, - }; + ENV.hosts.rmWebAddress = rmhost; + } else { + rmhost = ENV.hosts.rmWebAddress; } + Ember.Logger.log("RM Address: " + rmhost); + if(!ENV.hosts.timelineWebAddress) { var timelinehost = ""; $.ajax({ @@ -46,7 +48,7 @@ function updateConfigs(application) { dataType: 'json', async: true, context: this, - url: getTimeLineURL(), + url: getTimeLineURL(rmhost), success: function(data) { timelinehost = data.property.value; ENV.hosts.timelineWebAddress = timelinehost; @@ -54,24 +56,18 @@ function updateConfigs(application) { var address = timelinehost.split(":")[0]; var port = timelinehost.split(":")[1]; - Ember.Logger.log("Timeline Address from RM:" + address + ":" + port); + Ember.Logger.log("Timeline Address from RM: " + timelinehost); if(address === "0.0.0.0" || address === "localhost") { var updatedAddress = hostname + ":" + port; - - /* Timeline v2 is not supporting CORS, so make as default*/ - ENV = { - hosts: { - rmWebAddress: rmhost, - timelineWebAddress: updatedAddress, - }, - }; - Ember.Logger.log("Timeline Updated Address:" + updatedAddress); + ENV.hosts.timelineWebAddress = updatedAddress; + Ember.Logger.log("Timeline Updated Address: " + updatedAddress); } application.advanceReadiness(); - }, + } }); } else { + Ember.Logger.log("Timeline Address: " + ENV.hosts.timelineWebAddress); application.advanceReadiness(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org