public class SidebarHelper extends HelperBase
| Modifier and Type | Class and Description |
|---|---|
static class | SidebarHelper.NetworkStateEnumeration of network reachability state values. |
static class | SidebarHelper.NetworkStateMessageState message to be displayed to the user in the summary bar. |
| Modifier and Type | Field and Description |
|---|---|
(package private) I2PAppContext | ctxGlobal application context |
(package private) static String | DEFAULT_FULLDefault full summary bar sections |
(package private) static String | DEFAULT_FULL_ADVANCEDDefault full summary bar sections for advanced mode |
(package private) static String | DEFAULT_FULL_NEWUSERDefault full summary bar sections for new users |
(package private) static String | DEFAULT_MINIMALDefault minimal summary bar sections |
(package private) static String | DEFAULT_MINIMAL_ADVANCEDDefault minimal summary bar sections for advanced mode @since 0.9.32 |
(package private) String | firstVersionFirst version the router was started with, used to detect new installs |
(package private) static String | PROP_SUMMARYBARProperty prefix for summary bar section configuration per page |
(package private) static String | THINSPThin space separator |
(package private) String | versionCurrent I2P core version |
| Constructor and Description |
|---|
SidebarHelper() |
| Modifier and Type | Method and Description |
|---|---|
boolean | allowReseed()Whether manual reseed should be allowed, based on uptime and known router count
or the always-allow property. |
String | getAction()Form action or null. |
int | getActivePeers()How many peers we are talking to now |
int | getActiveProfiles()How many active identities have we spoken with recently |
int | getAllPeers()How many routers we know about, minus ourselves |
int | getAvgPeerTestTime()Average peer test round-trip time (good + too-slow combined) |
int | getAvgPeerTestTimeGood()Average successful peer test round-trip time |
int | getBanlistedPeers()How many peers are banned. |
String | getConcurrency()Concurrent build count and average build request time |
String | getConfigTable()Build the HTML table for configuring which sidebar sections are shown
and their display order. |
String | getConsoleNonce()Console nonce or null. |
String | getCPUBar()Render JVM CPU Load Bar |
int | getCPULoad()Retrieve CPU Load as a percentage. |
int | getCPULoadAvg()Retrieve CPU Load Average as a percentage. |
String | getDestinations()Client destinations connected locally. |
int | getFastPeers()How many active peers the router ranks as fast. |
String | getFirewallAndReseedStatus()The firewall status and reseed status/buttons |
String | getFiveMinuteKBps()Format the 5-minute average bandwidth rates for display. |
int | getHighCapacityPeers()How many active peers the router ranks as having a high capacity. |
String | getIdent()Retrieve the shortened 4 character ident for the router located within
the current JVM at the given context. |
String | getInboundBacklog()Inbound tunnel build queue size |
int | getInboundClientTunnels()How many inbound client tunnels we have. |
String | getInboundTransferred()How much data have we received since the router started (pretty printed
string with 2 decimal places and the appropriate units - GB/MB/KB/bytes) |
int | getInboundTunnels()How many free inbound tunnels we have. |
String | getJobLag()How lagged our job queue is over the last minute (pretty printed with
the units attached) |
String | getLifetimeKBps()Format the lifetime average bandwidth rates for display. |
String | getMaxParticipatingTunnels()Maximum number of tunnels we are willing to participate in,
either from config or a reasonable default based on system resources. |
String | getMemory()Retrieve amount of used memory. |
String | getMemoryBar()Render the memory usage bar with blended real-time and one-minute average |
String | getMessageDelay()How long it takes us to pump out a message, averaged over the last minute
(pretty printed with the units attached) |
NewsHelper | getNewsHelper()Stored NewsHelper. |
int | getOutboundClientTunnels()How many active outbound client tunnels we have. |
String | getOutboundTransferred()How much data have we sent since the router started (pretty printed
string with 2 decimal places and the appropriate units - GB/MB/KB/bytes) |
int | getOutboundTunnels()How many active outbound tunnels we have. |
int | getParticipatingTunnels()How many tunnels we are participating in. |
SidebarHelper.NetworkStateMessage | getReachability()Network reachability state and message. |
String | getRequestURI()Return the request URI, or /home as default. |
String | getRestartStatus()The restart status and buttons |
String | getSecondKBps()Format the current bandwidth rates for display. |
String | getShareRatio()Participant-to-client tunnel share ratio |
int | getStoredRouterInfos()Number of router infos stored in the Kademlia netDb |
List<String> | getSummaryBarSections(String page)Get the list of active summary bar sections for a given page |
int | getSystemLoad()Retrieve System Load Average as a percentage. |
int | getTunnelBuildSuccess()Retrieve Tunnel build success as a percentage. |
String | getTunnelLag()How long it takes us to test our tunnels, averaged over the last 10 minutes
(pretty printed with the units attached) |
String | getTunnelStatus()Localized tunnel status string (e.g. |
int | getUnreachablePeers()How many peers are unreachable. |
String | getUpdateNonce()Update nonce or null. |
String | getUpdateStatus()The update status and buttons |
String | getUptime()Retrieve a pretty printed uptime count (ala 4d or 7h or 39m) |
String | getVersion()Retrieve the version number of the router. |
int | getWellIntegratedPeers()How many active peers the router ranks as well integrated (floodfill). |
boolean | isAdvanced()True if advanced mode is enabled in config. |
boolean | isI2PTunnelRunning()Are both the webapp and TCG running? |
void | renderSummaryBar()Render the full summary bar HTML to the output writer |
(package private) static void | saveSummaryBarSections(RouterContext ctx,
String page,
Map<Integer,String> sections)Save the summary bar section order to router config |
void | setAction(String s)Form action, HTML-stripped before storing. |
void | setConsoleNonce(String s)Console nonce, HTML-stripped before storing. |
void | setRequest(HttpServletRequest s)Servlet request. |
void | setRequestURI(String s)Request URI, HTML-stripped before storing. |
void | setUpdateNonce(String s)Update nonce, HTML-stripped before storing. |
boolean | showFirewallWarning()Should we warn about a possible firewall problem? |
void | storeNewsHelper(NewsHelper n)NewsHelper to store for sidebar rendering. |
void | storeSession(HttpSession session)For form validation and session-bound nonce generation |
boolean | unifiedSidebar()True if unified sidebar is enabled. |
_t, _t, _t, _x, getChecked, ngettext, setContextId, storeWriterI2PAppContext ctx
static final String DEFAULT_FULL
static final String DEFAULT_FULL_ADVANCED
static final String DEFAULT_FULL_NEWUSER
static final String DEFAULT_MINIMAL
static final String DEFAULT_MINIMAL_ADVANCED
String firstVersion
static final String PROP_SUMMARYBAR
static final String THINSP
String version
public boolean allowReseed()
public String getAction()
public int getActivePeers()
public int getActiveProfiles()
public int getAllPeers()
public int getAvgPeerTestTime()
public int getAvgPeerTestTimeGood()
public int getBanlistedPeers()
public String getConcurrency()
public String getConfigTable()
public String getConsoleNonce()
public String getCPUBar()
public int getCPULoad()
public int getCPULoadAvg()
public String getDestinations()
public int getFastPeers()
public String getFirewallAndReseedStatus()
public String getFiveMinuteKBps()
public int getHighCapacityPeers()
public String getIdent()
public String getInboundBacklog()
public int getInboundClientTunnels()
public String getInboundTransferred()
public int getInboundTunnels()
public String getJobLag()
public String getLifetimeKBps()
public String getMaxParticipatingTunnels()
public String getMemory()
public String getMemoryBar()
public String getMessageDelay()
public NewsHelper getNewsHelper()
public int getOutboundClientTunnels()
public String getOutboundTransferred()
public int getOutboundTunnels()
public int getParticipatingTunnels()
public SidebarHelper.NetworkStateMessage getReachability()
public String getRequestURI()
public String getRestartStatus()
public String getSecondKBps()
public String getShareRatio()
public int getStoredRouterInfos()
public List<String> getSummaryBarSections(String page)
page - the page name (e.g. "home" or "default")public int getSystemLoad()
public int getTunnelBuildSuccess()
public String getTunnelLag()
public String getTunnelStatus()
public int getUnreachablePeers()
public String getUpdateNonce()
public String getUpdateStatus()
public String getUptime()
public String getVersion()
public int getWellIntegratedPeers()
public boolean isAdvanced()
isAdvanced in class HelperBasepublic boolean isI2PTunnelRunning()
public void renderSummaryBar()
throws IOExceptionIOExceptionstatic void saveSummaryBarSections(RouterContext ctx, String page, Map<Integer,String> sections)
ctx - router contextpage - page identifiersections - ordered map of section index to section idpublic void setAction(String s)
s - form action, HTML-stripped before storingpublic void setConsoleNonce(String s)
s - console nonce, HTML-stripped before storingpublic void setRequest(HttpServletRequest s)
s - the servlet requestpublic void setRequestURI(String s)
s - the request URI, HTML-stripped before storingpublic void setUpdateNonce(String s)
s - update nonce, HTML-stripped before storingpublic boolean showFirewallWarning()
public void storeNewsHelper(NewsHelper n)
n - NewsHelper to store for sidebar renderingpublic void storeSession(HttpSession session)
public boolean unifiedSidebar()