HDFS-11198. NN UI should link DN web address using hostnames. Contributed by Weiwei Yang.

This commit is contained in:
Kihwal Lee 2016-12-06 08:06:50 -06:00
parent 7b988e8899
commit 4dd4f3a4bb
2 changed files with 7 additions and 13 deletions

View File

@ -314,13 +314,7 @@
{#LiveNodes}
<tr>
<td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{name} ({xferaddr})</td>
<td ng-value="{state}-{name}">
{@select key=secureMode}
{@eq value="off"}<a href='//{infoAddr}'>{infoAddr}</a>{/eq}
{@eq value="on"}<a href='//{infoSecureAddr}'>{infoSecureAddr}</a>{/eq}
{@default}<a href='//{infoAddr}'>{infoAddr}</a>{/default}
{/select}
</td>
<td ng-value="{state}-{name}"><a href='//{dnWebAddress}'>{dnWebAddress}</a></td>
<td ng-value="{lastContact}">{lastContact}s</td>
<td ng-value="{usedPercentage}">
<div>

View File

@ -212,12 +212,12 @@
var n = nodes[i];
n.usedPercentage = Math.round((n.used + n.nonDfsUsedSpace) * 1.0 / n.capacity * 100);
var addr = n.infoSecureAddr;
var position = addr.lastIndexOf(":");
var port = addr.substring(position + 1, addr.length);
n.secureMode = "off";
if (port != 0) {
n.secureMode = "on";
var port = n.infoAddr.split(":")[1];
var securePort = n.infoSecureAddr.split(":")[1];
var dnHost = n.name.split(":")[0];
n.dnWebAddress = dnHost + ":" + port;
if (securePort != 0) {
n.dnWebAddress = dnHost + ":" + securePort;
}
if (n.adminState === "In Service") {