* HarvesterJob: Don't instantiate if disabled

* NetDb: Add netDb.exploreKeySet stat
    * netdb.jsp: Add parameter ?r=xxxxxx to view a single routerinfo,
      and ?r=. to view our own; change links on other pages too
This commit is contained in:
zzz
2008-09-12 13:37:22 +00:00
parent cf54dd159d
commit 825af3e6c1
12 changed files with 64 additions and 12 deletions

View File

@ -10,6 +10,8 @@ import net.i2p.router.RouterContext;
public class NetDbHelper {
private RouterContext _context;
private Writer _out;
private String _routerPrefix;
/**
* Configure this bean to query a particular router context
*
@ -27,15 +29,22 @@ public class NetDbHelper {
public NetDbHelper() {}
public void setWriter(Writer writer) { _out = writer; }
public void setRouter(String r) { _routerPrefix = r; }
public String getNetDbSummary() {
try {
if (_out != null) {
_context.netDb().renderStatusHTML(_out);
if (_routerPrefix != null)
_context.netDb().renderRouterInfoHTML(_out, _routerPrefix);
else
_context.netDb().renderStatusHTML(_out);
return "";
} else {
ByteArrayOutputStream baos = new ByteArrayOutputStream(32*1024);
_context.netDb().renderStatusHTML(new OutputStreamWriter(baos));
if (_routerPrefix != null)
_context.netDb().renderRouterInfoHTML(new OutputStreamWriter(baos), _routerPrefix);
else
_context.netDb().renderStatusHTML(new OutputStreamWriter(baos));
return new String(baos.toByteArray());
}
} catch (IOException ioe) {