I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit ad8bfbda authored by walking's avatar walking
Browse files

merge of 'afee8fe3ed03c61266ad369b5ce5408382948977'

     and 'cec49ea3b0b9120ba6e58435852fb18c06912c55'
parents 24683c19 6b8dffc4
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ import net.i2p.router.TunnelInfo; ...@@ -23,6 +23,7 @@ import net.i2p.router.TunnelInfo;
import net.i2p.router.TunnelPoolSettings; import net.i2p.router.TunnelPoolSettings;
import net.i2p.router.tunnel.HopConfig; import net.i2p.router.tunnel.HopConfig;
import net.i2p.router.tunnel.pool.TunnelPool; import net.i2p.router.tunnel.pool.TunnelPool;
import net.i2p.router.CommSystemFacade;
import net.i2p.stat.RateStat; import net.i2p.stat.RateStat;
import net.i2p.util.ObjectCounter; import net.i2p.util.ObjectCounter;
...@@ -229,7 +230,7 @@ public class TunnelRenderer { ...@@ -229,7 +230,7 @@ public class TunnelRenderer {
Set<Hash> peers = new HashSet(lc.objects()); Set<Hash> peers = new HashSet(lc.objects());
peers.addAll(pc.objects()); peers.addAll(pc.objects());
List<Hash> peerList = new ArrayList(peers); List<Hash> peerList = new ArrayList(peers);
Collections.sort(peerList, new HashComparator()); Collections.sort(peerList, new CountryComparator(this._context.commSystem()));
out.write("<h2><a name=\"peers\"></a>" + _("Tunnel Counts By Peer") + "</h2>\n"); out.write("<h2><a name=\"peers\"></a>" + _("Tunnel Counts By Peer") + "</h2>\n");
out.write("<table><tr><th>" + _("Peer") + "</th><th>" + _("Expl. + Client") + "</th><th>" + _("% of total") + "</th><th>" + _("Part. from + to") + "</th><th>" + _("% of total") + "</th></tr>\n"); out.write("<table><tr><th>" + _("Peer") + "</th><th>" + _("Expl. + Client") + "</th><th>" + _("% of total") + "</th><th>" + _("Part. from + to") + "</th><th>" + _("% of total") + "</th></tr>\n");
...@@ -295,6 +296,22 @@ public class TunnelRenderer { ...@@ -295,6 +296,22 @@ public class TunnelRenderer {
return ((Hash)l).toBase64().compareTo(((Hash)r).toBase64()); return ((Hash)l).toBase64().compareTo(((Hash)r).toBase64());
} }
} }
private static class CountryComparator implements Comparator<Hash> {
public CountryComparator(CommSystemFacade comm) {
this.comm = comm;
}
public int compare(Hash l, Hash r) {
// get both countries
String lc = this.comm.getCountry(l);
String rc = this.comm.getCountry(r);
// let String handle the rest
return lc.compareTo(rc);
}
private CommSystemFacade comm;
}
private String getCapacity(Hash peer) { private String getCapacity(Hash peer) {
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer); RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
......
2009-12-12 zzz 2009-12-12 zzz
* Disable InternalSockets until it's fixed * Disable InternalSockets until it's fixed
* Sort peers on tunnels.jsp by country
2009-12-11 zzz 2009-12-11 zzz
* Addressbook, susidns: Rework addressbook into a * Addressbook, susidns: Rework addressbook into a
......
...@@ -18,7 +18,7 @@ public class RouterVersion { ...@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 3; public final static long BUILD = 4;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment