java.lang.Object
net.i2p.router.web.helpers.SidebarRenderer
Helper for sidebar rendering and navigation.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router the sidebar describes.private final SidebarHelperSupplies the state the sidebar shows.(package private) static final String[]All section identifiers.private static final ThreadLocal<DateFormat> Formatter for the clock shown in the sidebar.Section name map.private StringId of the toggle control being rendered.Constructor Summary
ConstructorsConstructorDescriptionSidebarRenderer(RouterContext context, SidebarHelper helper) Create the renderer bound to the helper that supplies sidebar data.Method Summary
Modifier and TypeMethodDescriptionprivate StringTranslate a string.private StringTranslate a message.private static final StringTag only.private static voidappendValues(StringBuilder sb, double[] values) Appends graph values to the tooltip text.booleanTrue if the router is a floodfill router.private StringReturn data-rx and data-tx attributes for the dual-baseline canvas minigraph.(package private) static StringGet the local eepsite URL from the port mapper.private StringGives the checkbox that hides a sidebar section.private static StringWhere the translation is to two words or more, prevent splitting across lines.Renders the collapsible Advanced Configuration link section.The detailed router information table: identity, version and uptime.Renders the sidebar bandwidth graph HTML.Renders the collapsible bandwidth allocation section.Renders the volatile clock element showing the current time.Renders the collapsible job queue lag section.The CPU load bar.Renders the helper's destination section markup.Renders the helper's firewall and reseed status markup.Renders the collapsible Help and FAQ link section.Render the "I2P Internals" sidebar section.Render the "I2P Services" sidebar section.The memory usage bar.Renders the reachability section, including shutdown and restart countdowns.The newest news headlines, at most three and none older than 60 days.Renders the peer counts section, expanded in advanced mode.Renders the helper's restart status markup verbatim.Renders the general section, headed by the local router identity.Renders the compact router summary table for the general section.voidrenderSummaryHTML(Writer out) Note - Ensure all links in here are absolute, as the summary bar may be displayed on lower-level directory errors.Renders the tunnel counts section, split by direction and client use.Renders the per-category tunnel build status summary.Renders the update section, or nothing while no update is pending.
Field Details
ALL_SECTIONS
All section identifiers.SECTION_NAMES
_context
The router the sidebar describes._helper
Supplies the state the sidebar shows.toggleId
Id of the toggle control being rendered.CLOCK_FMT
Formatter for the clock shown in the sidebar.
Constructor Details
SidebarRenderer
Create the renderer bound to the helper that supplies sidebar data.- Parameters:
context- the router context to read router state fromhelper- the helper that supplies sidebar data and settings
Method Details
getToggle
Gives the checkbox that hides a sidebar section.- Returns:
- the html of the toggle checkbox
floodfillEnabled
public boolean floodfillEnabled()True if the router is a floodfill router.- Returns:
- whether the router is a floodfill
renderSummaryHTML
Note - Ensure all links in here are absolute, as the summary bar may be displayed on lower-level directory errors.- Parameters:
out- the writer the summary bar markup is written to- Throws:
IOException- if the writer rejects the summary bar
renderHelpAndFAQHTML
Renders the collapsible Help and FAQ link section.- Returns:
- the section markup
renderI2PServicesHTML
Render the "I2P Services" sidebar section.- Returns:
- the section markup
getEepsiteURL
Get the local eepsite URL from the port mapper.- Parameters:
pm- the port mapper to resolve the eepsite port against- Returns:
- null if none
renderClockHTML
Renders the volatile clock element showing the current time.- Returns:
- the section markup
renderI2PInternalsHTML
Render the "I2P Internals" sidebar section.- Returns:
- the section markup
renderAdvancedHTML
Renders the collapsible Advanced Configuration link section.- Returns:
- the section markup
renderRouterInfoHTML
Renders the general section, headed by the local router identity.- Returns:
- the section markup, empty when no helper is bound
renderShortRouterInfoHTML
Renders the compact router summary table for the general section.- Returns:
- the section markup, empty when no helper is bound
renderAdvancedRouterInfoHTML
The detailed router information table: identity, version and uptime.- Returns:
- the section markup, empty when no helper is bound
renderMemoryBarHTML
The memory usage bar.- Returns:
- the memory bar markup, empty when no helper is bound
renderCPUBarHTML
The CPU load bar.- Returns:
- the CPU bar markup, empty when no helper is bound
renderNetworkReachabilityHTML
Renders the reachability section, including shutdown and restart countdowns.- Returns:
- the section markup, empty when no helper is bound
renderUpdateStatusHTML
Renders the update section, or nothing while no update is pending.- Returns:
- the section markup
renderRestartStatusHTML
Renders the helper's restart status markup verbatim.- Returns:
- the section markup, empty when no helper is bound
renderPeersHTML
Renders the peer counts section, expanded in advanced mode.- Returns:
- the section markup, empty when no helper is bound
renderFirewallAndReseedStatusHTML
Renders the helper's firewall and reseed status markup.- Returns:
- the section markup, empty when no helper is bound
renderBandwidthHTML
Renders the collapsible bandwidth allocation section.- Returns:
- the section markup, empty when no helper is bound
renderBandwidthGraphHTML
Renders the sidebar bandwidth graph HTML. Whenrouterconsole.sidebarGraphLegacyis false, emits data-rx/data-tx attributes for the dual-baseline canvas renderer (inbound inverted top, outbound normal bottom). Otherwise, serves the RRD4J SVG.- Returns:
- the graph markup: data attributes for the canvas renderer, or an RRD4J SVG in legacy mode
getDataAttributes
Return data-rx and data-tx attributes for the dual-baseline canvas minigraph. Uses the live bandwidth ring buffer when available (≥ 400 samples), falling back to 1-min RRD averages + live BPS. Inbound renders in the top half (inverted), outbound in the bottom half.- Returns:
- the data attributes
appendValues
Appends graph values to the tooltip text.- Parameters:
sb- where the text is writtenvalues- the values to append
renderTunnelsHTML
Renders the tunnel counts section, split by direction and client use.- Returns:
- the section markup, empty when no helper is bound
renderCongestionHTML
Renders the collapsible job queue lag section.- Returns:
- the section markup, empty when no helper is bound
renderTunnelStatusHTML
Renders the per-category tunnel build status summary.- Returns:
- the section markup, empty when no helper is bound
renderDestinationsHTML
Renders the helper's destination section markup.- Returns:
- the section markup, empty when no helper is bound
renderNewsHeadingsHTML
The newest news headlines, at most three and none older than 60 days.- Returns:
- the section markup, empty when no helper is bound or the current news has already been hidden
_x
_t
_t
nbsp