YARN-8906. [UI2] NM hostnames not displayed correctly in Node Heatmap Chart. Contributed by Akhil PB.
(cherry picked from commit 59719dc560
)
This commit is contained in:
parent
58042dadc3
commit
2f012044ff
|
@ -230,12 +230,14 @@ export default BaseChartComponent.extend({
|
||||||
var node_id = data.get("id"),
|
var node_id = data.get("id"),
|
||||||
node_addr = encodeURIComponent(data.get("nodeHTTPAddress")),
|
node_addr = encodeURIComponent(data.get("nodeHTTPAddress")),
|
||||||
href = `#/yarn-node/${node_id}/${node_addr}/info`;
|
href = `#/yarn-node/${node_id}/${node_addr}/info`;
|
||||||
|
var nodeHostName = data.get("nodeHostName");
|
||||||
var a = g.append("a")
|
var a = g.append("a")
|
||||||
.attr("href", href);
|
.attr("href", href);
|
||||||
a.append("text")
|
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("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");
|
.attr("class", this.isNodeSelected(data) ? "heatmap-cell" : "heatmap-cell-notselected");
|
||||||
if (this.isNodeSelected(data)) {
|
if (this.isNodeSelected(data)) {
|
||||||
this.bindTP(a, rect);
|
this.bindTP(a, rect);
|
||||||
|
|
|
@ -25,4 +25,3 @@
|
||||||
<select id="heatmap-select" class="form-control"></select>
|
<select id="heatmap-select" class="form-control"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p/>
|
|
Loading…
Reference in New Issue