YARN-8906. [UI2] NM hostnames not displayed correctly in Node Heatmap Chart. Contributed by Akhil PB.

This commit is contained in:
Sunil G 2019-06-03 15:53:23 +05:30
parent 7f46dda513
commit 59719dc560
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -25,4 +25,3 @@
<select id="heatmap-select" class="form-control"></select>
</div>
</div>
<p/>