From 6be665cfc6850aea612f40e26b3b6d5c0a0a3f41 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Mon, 3 Jun 2019 15:53:23 +0530 Subject: [PATCH] YARN-8906. [UI2] NM hostnames not displayed correctly in Node Heatmap Chart. Contributed by Akhil PB. (cherry picked from commit 59719dc560cf67f485d8e5b4a6f0f38ef97d536b) --- .../src/main/webapp/app/components/nodes-heatmap.js | 6 ++++-- .../main/webapp/app/templates/components/nodes-heatmap.hbs | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js index 1f772defcd2..7eac266505a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js @@ -230,12 +230,14 @@ export default BaseChartComponent.extend({ var node_id = data.get("id"), node_addr = encodeURIComponent(data.get("nodeHTTPAddress")), href = `#/yarn-node/${node_id}/${node_addr}/info`; + var nodeHostName = data.get("nodeHostName"); var a = g.append("a") .attr("href", href); a.append("text") - .text(data.get("nodeHostName")) + .text(nodeHostName.length > 30 ? nodeHostName.substr(0, 30) + '...' : nodeHostName) .attr("y", yOffset + this.CELL_HEIGHT / 2 + 5) - .attr("x", xOffset + this.CELL_WIDTH / 2) + .attr("x", nodeHostName.length > 30 ? xOffset + 10 : xOffset + this.CELL_WIDTH / 2) + .style("text-anchor", nodeHostName.length > 30 ? "start" : "middle") .attr("class", this.isNodeSelected(data) ? "heatmap-cell" : "heatmap-cell-notselected"); if (this.isNodeSelected(data)) { this.bindTP(a, rect); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs index f68bba6b8bc..d1ac8e7a30f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs @@ -25,4 +25,3 @@ -

\ No newline at end of file