ipv6 fixes for Network.html front page

This commit is contained in:
Michael Peter Christen 2014-10-07 21:57:41 +02:00
parent 460858fb22
commit ae58b22f5b
2 changed files with 17 additions and 5 deletions

View File

@ -247,7 +247,7 @@ document.getElementById("apilink").setAttribute("href", "Network.xml?" + window.
</tr> </tr>
<tr class="TableCellLight"> <tr class="TableCellLight">
<td>#[my-name]##(my-ssl)#::<img src="env/grafics/lock.gif" width="11" height="15" title="https supported" alt="https supported" />#(/my-ssl)#</td> <td>#[my-name]##(my-ssl)#::<img src="env/grafics/lock.gif" width="11" height="15" title="https supported" alt="https supported" />#(/my-ssl)#</td>
<td>#(my-info)#<img src="env/grafics/Virgin.gif" width="11" height="11" title="Type: Virgin" alt="Virgin" />::<img src="env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior" alt="Junior" />::<img src="env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior" alt="Senior" />::<img src="env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal" alt="Principal" />#(/my-info)##(my-acceptcrawl)#<img src="env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="Crawl enabled" />#(/my-acceptcrawl)##(my-dhtreceive)#<img src="env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no" alt="no DHT receive" />::<img src="env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT Receive enabled" />#(/my-dhtreceive)##(my-nodestate)#<img src="env/grafics/RootStateNo.gif" width="11" height="11" title="Not a Node Candidate" alt="no node candidate" />::<img src="env/grafics/RootStateYes.gif" width="11" height="11" title="Node Candidate" alt="node candidate" />#(/my-nodestate)#</td> <td nowrap>#(my-info)#<img src="env/grafics/Virgin.gif" width="11" height="11" title="Type: Virgin" alt="Virgin" />::<img src="env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior" alt="Junior" />::<img src="env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior" alt="Senior" />::<img src="env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal" alt="Principal" />#(/my-info)##(my-acceptcrawl)#<img src="env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="Crawl enabled" />#(/my-acceptcrawl)##(my-dhtreceive)#<img src="env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no" alt="no DHT receive" />::<img src="env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT Receive enabled" />#(/my-dhtreceive)##{ips}#<a href="#(c)#http://#(ipv6)#::[#(/ipv6)##[ip]##(ipv6)#::]#(/ipv6)#:#[port]#/Network.html?page=1::Network.html?page=4&amp;peerHash=#[hash]#&amp;peerIP=#[ip]#&amp;peerPort=#[port]#&amp;addPeer=add+Peer#(/c)#"#(c)#:: target="_blank"#(/c)#class="forceNoExternalIcon"><img src="env/grafics/#(nodestate)#NodeDisqualified::NodeQualified#(/nodestate)##(c)##(ipv6)#IPv4::IPv6#(/ipv6)#::#(ipv6)#IPv4::IPv6#(/ipv6)##(/c)#.gif" width="11" height="11" title="#(c)##(ipv6)#IPv4::IPv6#(/ipv6)#::#(ipv6)#IPv4::IPv6#(/ipv6)##(/c)# #(nodestate)#Peer::Node Peer#(/nodestate)#" /></a>#{/ips}#</td>
<td align="right">#[my-version]#</td> <td align="right">#[my-version]#</td>
<td align="right">#[my-utc]#</td> <td align="right">#[my-utc]#</td>
<td align="right">#[my-uptime]#</td> <td align="right">#[my-uptime]#</td>

View File

@ -110,21 +110,33 @@ public class Network {
prop.putHTML("table_my-name", seed.get(Seed.NAME, "-") ); prop.putHTML("table_my-name", seed.get(Seed.NAME, "-") );
prop.put("table_my-hash", seed.hash ); prop.put("table_my-hash", seed.hash );
prop.put("table_my-ssl", sb.peers.mySeed().getFlagSSLAvailable() ? 1 : 0); prop.put("table_my-ssl", sb.peers.mySeed().getFlagSSLAvailable() ? 1 : 0);
if (sb.peers.mySeed().isVirgin()) { if (seed.isVirgin()) {
prop.put("table_my-info", 0); prop.put("table_my-info", 0);
} else if(sb.peers.mySeed().isJunior()) { } else if (seed.isJunior()) {
prop.put("table_my-info", 1); prop.put("table_my-info", 1);
accPotLinks += LCount; accPotLinks += LCount;
accPotWords += ICount; accPotWords += ICount;
} else if(sb.peers.mySeed().isSenior()) { } else if (seed.isSenior()) {
prop.put("table_my-info", 2); prop.put("table_my-info", 2);
accActLinks += LCount; accActLinks += LCount;
accActWords += ICount; accActWords += ICount;
} else if(sb.peers.mySeed().isPrincipal()) { } else if (seed.isPrincipal()) {
prop.put("table_my-info", 3); prop.put("table_my-info", 3);
accActLinks += LCount; accActLinks += LCount;
accActWords += ICount; accActWords += ICount;
} }
String port = seed.get(Seed.PORT, "-");
Set<String> ips = seed.getIPs();
int ipsc = 0;
for (String s: ips) {
prop.put("table_ips_" + ipsc + "_nodestate", seed.getFlagRootNode() ? 1 : 0);
prop.put("table_ips_" + ipsc + "_c", 0);
prop.putHTML("table_ips_" + ipsc + "_c_hash", seed.hash);
prop.putHTML("table_ips_" + ipsc + "_c_ip", s);
prop.putHTML("table_ips_" + ipsc + "_c_port", port);
prop.put("table_ips_" + ipsc++ + "_c_ipv6", s.indexOf(':') >= 0 ? 1 : 0);
}
prop.put("table_ips", ipsc);
prop.put("table_my-acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0); prop.put("table_my-acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0);
prop.put("table_my-dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0); prop.put("table_my-dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0);
prop.put("table_my-nodestate", seed.getFlagRootNode() ? 1 : 0); prop.put("table_my-nodestate", seed.getFlagRootNode() ? 1 : 0);