2005-05-01 00:48:15 +00:00
|
|
|
package net.i2p.router.web;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
2009-01-29 02:16:18 +00:00
|
|
|
public class PeerHelper extends HelperBase {
|
2006-05-18 03:00:48 +00:00
|
|
|
private int _sortFlags;
|
|
|
|
private String _urlBase;
|
2005-05-01 00:48:15 +00:00
|
|
|
|
|
|
|
public PeerHelper() {}
|
|
|
|
|
2006-05-18 03:00:48 +00:00
|
|
|
public void setSort(String flags) {
|
|
|
|
if (flags != null) {
|
|
|
|
try {
|
|
|
|
_sortFlags = Integer.parseInt(flags);
|
|
|
|
} catch (NumberFormatException nfe) {
|
|
|
|
_sortFlags = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_sortFlags = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public void setUrlBase(String base) { _urlBase = base; }
|
2005-05-01 00:48:15 +00:00
|
|
|
|
|
|
|
public String getPeerSummary() {
|
|
|
|
try {
|
2006-05-18 03:00:48 +00:00
|
|
|
_context.commSystem().renderStatusHTML(_out, _urlBase, _sortFlags);
|
2005-10-29 21:35:24 +00:00
|
|
|
_context.bandwidthLimiter().renderStatusHTML(_out);
|
2005-05-01 00:48:15 +00:00
|
|
|
} catch (IOException ioe) {
|
|
|
|
ioe.printStackTrace();
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|