HDFS-11198. NN UI should link DN web address using hostnames. Contributed by Weiwei Yang.
This commit is contained in:
parent
6bd600eef2
commit
f74dad7414
|
@ -314,13 +314,7 @@
|
||||||
{#LiveNodes}
|
{#LiveNodes}
|
||||||
<tr>
|
<tr>
|
||||||
<td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{name} ({xferaddr})</td>
|
<td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{name} ({xferaddr})</td>
|
||||||
<td ng-value="{state}-{name}">
|
<td ng-value="{state}-{name}"><a href='//{dnWebAddress}'>{dnWebAddress}</a></td>
|
||||||
{@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="{lastContact}">{lastContact}s</td>
|
<td ng-value="{lastContact}">{lastContact}s</td>
|
||||||
<td ng-value="{usedPercentage}">
|
<td ng-value="{usedPercentage}">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -212,12 +212,12 @@
|
||||||
var n = nodes[i];
|
var n = nodes[i];
|
||||||
n.usedPercentage = Math.round((n.used + n.nonDfsUsedSpace) * 1.0 / n.capacity * 100);
|
n.usedPercentage = Math.round((n.used + n.nonDfsUsedSpace) * 1.0 / n.capacity * 100);
|
||||||
|
|
||||||
var addr = n.infoSecureAddr;
|
var port = n.infoAddr.split(":")[1];
|
||||||
var position = addr.lastIndexOf(":");
|
var securePort = n.infoSecureAddr.split(":")[1];
|
||||||
var port = addr.substring(position + 1, addr.length);
|
var dnHost = n.name.split(":")[0];
|
||||||
n.secureMode = "off";
|
n.dnWebAddress = dnHost + ":" + port;
|
||||||
if (port != 0) {
|
if (securePort != 0) {
|
||||||
n.secureMode = "on";
|
n.dnWebAddress = dnHost + ":" + securePort;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.adminState === "In Service") {
|
if (n.adminState === "In Service") {
|
||||||
|
|
Loading…
Reference in New Issue