java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ProfilesHelper
Helper for peer profiles page rendering and form processing.
Field Summary
FieldsFields inherited from class HelperBase
_context, _log, _out, CHECKED, PROP_ADVANCED, SELECTEDModifier and TypeFieldDescriptionprotected RouterContextThe router context.protected LogThe log instance.protected WriterThe writer for output.static final StringChecked attribute for HTML checkboxes.static final StringProperty key for advanced mode.static final StringSelected attribute for HTML select options.Constructor Summary
ConstructorsConstructorDescriptionStarts on tab 0, which lists every profile;setFull(String)or setShow() moves the helper to a single tier before anything is rendered.Method Summary
Modifier and TypeMethodDescriptionRenders the compact banlist fragment: every blocked router and the reason, in the condensed one-line-per-entry layout.Renders the profile summary fragment: the per-peer status list in either the full or the compact form, per_full.Render and return the profile summary page.private intgetTab()Return the currently selected profiles tab index.voidrenderFragment(String id) Render only the named element for the contentonly fragment mode.private voidRender the profiles navigation bar.voidParses the requested tier number, ignoring anything unparsable or out of range.voidSet by show=fast|highcap|floodfill|banned param (alternative to f=N).Methods inherited from class HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriterModifier and TypeMethodDescriptionTranslate a string.Translate a string with a parameter.Translate a string with two parameters.static StringMark a string for extraction by xgettext and translation.protected StringgetChecked(String prop) Get the checked attribute for a boolean property.booleanCheck if advanced mode is enabled.Translate a string with plural forms (ngettext).voidsetContextId(String contextId) Configure this bean to query a particular router context.voidstoreWriter(Writer out) Store the writer for output.
Field Details
_full
private int _fullWhich version of the page is shown.titles
Heading for each profile row.links
Help link for each profile row.
Constructor Details
ProfilesHelper
public ProfilesHelper()Starts on tab 0, which lists every profile;setFull(String)or setShow() moves the helper to a single tier before anything is rendered.
Method Details
setFull
Parses the requested tier number, ignoring anything unparsable or out of range.- Parameters:
f- the profile tier to show, 0 for all, clamped to 0-4 when it parses
setShow
Set by show=fast|highcap|floodfill|banned param (alternative to f=N). Overrides _full if present.- Parameters:
show- the tier name to map to the numeric tier, or null to leave _full alone
getSummary
Render and return the profile summary page.- Returns:
- empty string, writes directly to _out
getProfileSummary
getBanlistCompact
Renders the compact banlist fragment: every blocked router and the reason, in the condensed one-line-per-entry layout.- Returns:
- empty string, writes directly to _out
renderFragment
Render only the named element for the contentonly fragment mode. Renders nothing for ids the current tab does not own; unknown ids produce an empty response.- Parameters:
id- the element id- Throws:
IOException- if an I/O error occurs
getTab
private int getTab()Return the currently selected profiles tab index.- Returns:
- 0 for the short view, 1 for the full view