forked from I2P_Developers/i2p.i2p
Console sidebar improvements
Sidebar: - Adjust vertical spacing of general section - Rename 'General' section to 'Router Info' and move ident info to h3 tooltip (ticket #1996) - Replace 'Short Router Info' with a new 'Advanced Router Info' section in default advanced sidebar (adds memory usage and clock skew) - Add optional embedded bandwidth graph (experimental) - Add optional memory usage bar - Add optional Advanced Peers section (adds failing and banned peers) - Add Help link to 'I2P Internals' section - Add help page anchored links and troubleshooting to 'Help & FAQ' section - Add download progress bar for router and plugin updates - Add 'Advanced Minimal' sidebar configuration - Add Jobs and Events links to Advanced section - Add additional reachability states for clockskew and vmcomm (with icons) Homepage: Add 'Customize Sidebar' link to signpost the feature now that there are more optional sections available (ticket #1996)
This commit is contained in:
@ -997,13 +997,18 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
|
||||
public void notifyProgress(UpdateTask task, String status, long downloaded, long totalSize) {
|
||||
StringBuilder buf = new StringBuilder(64);
|
||||
buf.append(status).append(' ');
|
||||
buf.append("<div class=\"sb_updatestatus\">");
|
||||
buf.append(status).append("</div>");
|
||||
double pct = ((double)downloaded) / ((double)totalSize);
|
||||
synchronized (_pct) {
|
||||
buf.append("<div class=\"percentBarOuter\"><div class=\"percentBarText\">");
|
||||
buf.append(DataHelper.formatSize2(downloaded));
|
||||
buf.append("B / ");
|
||||
buf.append(DataHelper.formatSize2(totalSize));
|
||||
buf.append("B</div><div class=\"percentBarInner\" style=\"width: ");
|
||||
buf.append(_pct.format(pct));
|
||||
buf.append("\">");
|
||||
}
|
||||
buf.append("<br>\n");
|
||||
buf.append(_t("{0}B transferred", DataHelper.formatSize2(downloaded)));
|
||||
updateStatus(buf.toString());
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ class UpdateHandler implements Updater {
|
||||
return null;
|
||||
UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources);
|
||||
// set status before thread to ensure UI feedback
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + "</b>");
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + " I2P</b>");
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (_isPartial)
|
||||
return;
|
||||
long d = currentWrite + bytesTransferred;
|
||||
String status = "<b>" + _t("Updating") + "</b>";
|
||||
String status = "<b>" + _t("Updating") + " I2P</b>";
|
||||
_mgr.notifyProgress(this, status, d, d + bytesRemaining);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ConfigSummaryHandler extends FormHandler {
|
||||
addFormNotice(_t("Full summary bar default restored.") + " " +
|
||||
_t("Summary bar will refresh shortly."));
|
||||
} else if (_action.equals(_t("Restore minimal default"))) {
|
||||
_context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_MINIMAL);
|
||||
_context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", isAdvanced() ? SummaryHelper.DEFAULT_MINIMAL_ADVANCED : SummaryHelper.DEFAULT_MINIMAL);
|
||||
addFormNotice(_t("Minimal summary bar default restored.") + " " +
|
||||
_t("Summary bar will refresh shortly."));
|
||||
} else if (adding || deleting || saving || moving) {
|
||||
|
@ -32,6 +32,7 @@ public class HomeHelper extends HelperBase {
|
||||
// FIXME wasn't escaped
|
||||
_x("Configure UI") + S + _x("Select console theme & language & set optional console password").replace("&", "&") + S + "/configui" + S + I + "info/ui.png" + S +
|
||||
_x("Customize Home Page") + S + _x("I2P Home Page Configuration") + S + "/confighome" + S + I + "home_page.png" + S +
|
||||
_x("Customize Sidebar") + S + _x("Customize the sidebar by adding or removing or repositioning elements") + S + "/configsidebar" + S + I + "info/sidebar.png" + S +
|
||||
_x("Email") + S + _x("Anonymous webmail client") + S + "/susimail/susimail" + S + I + "email.png" + S +
|
||||
_x("Help") + S + _x("I2P Router Help") + S + "/help" + S + I + "support.png" + S +
|
||||
_x("Manage Plugins") + S + _x("Install and configure I2P plugins") + S + "/configplugins" + S + I + "plugin.png" + S +
|
||||
|
@ -26,8 +26,8 @@ import net.i2p.util.SystemVersion;
|
||||
class SummaryBarRenderer {
|
||||
|
||||
static final String ALL_SECTIONS[] =
|
||||
{"HelpAndFAQ", "I2PServices", "I2PInternals", "General", "ShortGeneral", "NetworkReachability",
|
||||
"UpdateStatus", "RestartStatus", "Peers", "FirewallAndReseedStatus", "Bandwidth", "Tunnels",
|
||||
{"HelpAndFAQ", "I2PServices", "I2PInternals", "RouterInfo", "ShortRouterInfo", "AdvancedRouterInfo", "MemoryBar", "NetworkReachability",
|
||||
"UpdateStatus", "RestartStatus", "Peers", "PeersAdvanced", "FirewallAndReseedStatus", "Bandwidth", "BandwidthGraph", "Tunnels",
|
||||
"Congestion", "TunnelStatus", "Destinations", "NewsHeadings", "Advanced" };
|
||||
static final Map<String, String> SECTION_NAMES;
|
||||
|
||||
@ -36,20 +36,24 @@ class SummaryBarRenderer {
|
||||
aMap.put("HelpAndFAQ", "Help & FAQ");
|
||||
aMap.put("I2PServices", "I2P Services");
|
||||
aMap.put("I2PInternals", "I2P Internals");
|
||||
aMap.put("General", "General");
|
||||
aMap.put("ShortGeneral", "Short General");
|
||||
aMap.put("RouterInfo", "Router Information");
|
||||
aMap.put("ShortRouterInfo", "Short Router Information");
|
||||
aMap.put("AdvancedRouterInfo", "Router Information (advanced)");
|
||||
aMap.put("MemoryBar", "Memory Usage Bar");
|
||||
aMap.put("NetworkReachability", "Network Reachability");
|
||||
aMap.put("UpdateStatus", "Update Status");
|
||||
aMap.put("RestartStatus", "Restart Status");
|
||||
aMap.put("Peers", "Peers");
|
||||
aMap.put("PeersAdvanced", "Peers (advanced)");
|
||||
aMap.put("FirewallAndReseedStatus", "Firewall & Reseed Status");
|
||||
aMap.put("Bandwidth", "Bandwidth");
|
||||
aMap.put("BandwidthGraph", "Bandwidth Graph (experimental)");
|
||||
aMap.put("Tunnels", "Tunnels");
|
||||
aMap.put("Congestion", "Congestion");
|
||||
aMap.put("TunnelStatus", "Tunnel Status");
|
||||
aMap.put("Destinations", "Local Tunnels");
|
||||
aMap.put("NewsHeadings", "News & Updates");
|
||||
aMap.put("Advanced", "Advanced");
|
||||
aMap.put("Advanced", "Advanced Console Links");
|
||||
SECTION_NAMES = Collections.unmodifiableMap(aMap);
|
||||
}
|
||||
|
||||
@ -91,10 +95,14 @@ class SummaryBarRenderer {
|
||||
buf.append(renderI2PInternalsHTML());
|
||||
else if ("Advanced".equals(section))
|
||||
buf.append(renderAdvancedHTML());
|
||||
else if ("General".equals(section))
|
||||
buf.append(renderGeneralHTML());
|
||||
else if ("ShortGeneral".equals(section))
|
||||
buf.append(renderShortGeneralHTML());
|
||||
else if ("RouterInfo".equals(section) || "General".equals(section)) // Backwards-compatibility
|
||||
buf.append(renderRouterInfoHTML());
|
||||
else if ("ShortRouterInfo".equals(section) || "ShortGeneral".equals(section)) //Backwards-compatibility
|
||||
buf.append(renderShortRouterInfoHTML());
|
||||
else if ("AdvancedRouterInfo".equals(section))
|
||||
buf.append(renderAdvancedRouterInfoHTML());
|
||||
else if ("MemoryBar".equals(section))
|
||||
buf.append(renderMemoryBarHTML());
|
||||
else if ("NetworkReachability".equals(section))
|
||||
buf.append(renderNetworkReachabilityHTML());
|
||||
else if ("UpdateStatus".equals(section))
|
||||
@ -103,10 +111,14 @@ class SummaryBarRenderer {
|
||||
buf.append(renderRestartStatusHTML());
|
||||
else if ("Peers".equals(section))
|
||||
buf.append(renderPeersHTML());
|
||||
else if ("PeersAdvanced".equals(section))
|
||||
buf.append(renderPeersAdvancedHTML());
|
||||
else if ("FirewallAndReseedStatus".equals(section))
|
||||
buf.append(renderFirewallAndReseedStatusHTML());
|
||||
else if ("Bandwidth".equals(section))
|
||||
buf.append(renderBandwidthHTML());
|
||||
else if ("BandwidthGraph".equals(section))
|
||||
buf.append(renderBandwidthGraphHTML());
|
||||
else if ("Tunnels".equals(section))
|
||||
buf.append(renderTunnelsHTML());
|
||||
else if ("Congestion".equals(section))
|
||||
@ -130,7 +142,59 @@ class SummaryBarRenderer {
|
||||
.append(_t("I2P Router Help & FAQ"))
|
||||
.append("\">")
|
||||
.append(_t("Help & FAQ"))
|
||||
.append("</a></h3>");
|
||||
.append("</a></h3><hr class=\"b\">\n" +
|
||||
|
||||
"<table id=\"sb_help\"><tr><td>" +
|
||||
|
||||
"<a href=\"/help#advancedsettings\" target=\"_top\" title=\"")
|
||||
.append(_t("A guide to some of the less-used configuration settings"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Advanced Settings")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#changelog\" target=\"_top\" title=\"")
|
||||
.append(_t("Recent development changes to the router"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Changelog")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#configurationhelp\" target=\"_top\" title=\"")
|
||||
.append(_t("An introduction to configuring your router"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Configuration")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#faq\" target=\"_top\" title=\"")
|
||||
.append(_t("A shortened version of the official Frequently Asked Questions"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("FAQ")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#legal\" target=\"_top\" title=\"")
|
||||
.append(_t("Information regarding software and licenses used by I2P"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Legal")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#reachability\" target=\"_top\" title=\"")
|
||||
.append(_t("A short guide to the sidebar's network reachability notification"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Reachability")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/help#sidebarhelp\" target=\"_top\" title=\"")
|
||||
.append(_t("An introduction to the router sidebar"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Sidebar")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/console#trouble\" target=\"_top\" title=\"")
|
||||
.append(_t("Troubleshooting & Further Assistance"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Troubleshoot")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("</td></tr></table>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@ -196,18 +260,18 @@ class SummaryBarRenderer {
|
||||
.append("</a>\n");
|
||||
}
|
||||
|
||||
buf.append("<a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"")
|
||||
buf.append("<a href=\"/help\" target=\"_top\" title=\"")
|
||||
.append(_t("Router Help and FAQ"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Help")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"")
|
||||
.append(_t("Local Tunnels"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Hidden Services Manager")))
|
||||
.append("</a>\n" +
|
||||
|
||||
// "<a href=\"/jobs.jsp\" target=\"_top\" title=\"")
|
||||
// .append(_t("Show the router's workload, and how it's performing"))
|
||||
// .append("\">")
|
||||
// .append(_t("Jobs"))
|
||||
// .append("</a>\n" +
|
||||
|
||||
"<a href=\"/logs\" target=\"_top\" title=\"")
|
||||
.append(_t("Health Report"))
|
||||
.append("\">")
|
||||
@ -247,13 +311,13 @@ class SummaryBarRenderer {
|
||||
|
||||
buf.append("<h3 id=\"advanced\"><a title=\"")
|
||||
.append(_t("Advanced Configuration"))
|
||||
.append("\" href=\"/configadvanced\">")
|
||||
.append("\" href=\"/configadvanced\" target=\"_top\">")
|
||||
.append(_t("Advanced"))
|
||||
.append("</a></h3>\n")
|
||||
|
||||
.append("<hr class=\"b\"><table id=\"sb_advanced\"><tr><td>")
|
||||
|
||||
.append("<a title=\"")
|
||||
.append("<a target=\"_top\" title=\"")
|
||||
.append(_t("Review active encryption certificates used in console"))
|
||||
.append("\" href=\"/certs\">")
|
||||
.append(nbsp(_t("Certs")))
|
||||
@ -267,35 +331,49 @@ class SummaryBarRenderer {
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("View router debug information"))
|
||||
.append("\" href=\"/debug\">")
|
||||
.append("\" href=\"/debug\" target=\"_top\">")
|
||||
.append(nbsp(_t("Debug")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("<a href=\"/events\" target=\"_top\" title=\"")
|
||||
.append(_t("View historical log of router events"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Events")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("Review extended info about installed .jar and .war files"))
|
||||
.append("\" href=\"/jars\">")
|
||||
.append("\" href=\"/jars\" target=\"_top\">")
|
||||
.append(nbsp(_t("Jars")))
|
||||
.append("</a>\n");
|
||||
|
||||
File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html");
|
||||
if (javadoc.exists())
|
||||
buf.append("<a href=\"/javadoc/index.html\" target=\"_blank\">Javadoc</a>\n");
|
||||
buf.append("<a title=\"")
|
||||
.append(_t("Documentation for the I2P API"))
|
||||
.append("\" href=\"/javadoc/index.html\" target=\"_blank\">Javadoc</a>\n");
|
||||
|
||||
buf.append("<a title=\"")
|
||||
buf.append("<a href=\"/jobs\" target=\"_top\" title=\"")
|
||||
.append(_t("Show the router's workload, and how it's performing"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Jobs")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("View active leasesets (debug mode)"))
|
||||
.append("\" href=\"/netdb?l=2\">")
|
||||
.append("\" href=\"/netdb?l=2\" target=\"_top\">")
|
||||
.append(nbsp(_t("LeaseSets")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("Network database search tool"))
|
||||
.append("\" href=\"/netdb?f=4\">")
|
||||
.append("\" href=\"/netdb?f=4\" target=\"_top\">")
|
||||
.append(nbsp(_t("NetDB Search")))
|
||||
.append("</a>\n")
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("Signed proof of ownership of this router"))
|
||||
.append("\" href=\"/proof\">")
|
||||
.append("\" href=\"/proof\" target=\"_top\">")
|
||||
.append(nbsp(_t("Proof")))
|
||||
.append("</a>\n")
|
||||
|
||||
@ -307,7 +385,7 @@ class SummaryBarRenderer {
|
||||
|
||||
.append("<a title=\"")
|
||||
.append(_t("Review possible sybils in network database"))
|
||||
.append("\" href=\"/netdb?f=3\">")
|
||||
.append("\" href=\"/netdb?f=3\" target=\"_top\">")
|
||||
.append(nbsp(_t("Sybils")))
|
||||
.append("</a>\n")
|
||||
|
||||
@ -315,34 +393,17 @@ class SummaryBarRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String renderGeneralHTML() {
|
||||
public String renderRouterInfoHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
buf.append("<h3><a href=\"/help\" target=\"_top\" title=\"")
|
||||
.append(_t("I2P Router Help"))
|
||||
buf.append("<h3><a href=\"/netdb?r=.\" target=\"_top\" title=\"")
|
||||
.append(_t("Your Local Identity [{0}] is your unique I2P router identity, similar to an IP address but tailored to I2P. ", _helper.getIdent()))
|
||||
.append(_t("Never disclose this to anyone, as it can reveal your real world IP."))
|
||||
.append("\">")
|
||||
.append(_t("General"))
|
||||
.append(_t("Router Info"))
|
||||
.append("</a></h3><hr class=\"b\">\n" +
|
||||
|
||||
"<table id=\"sb_localid\"><tr>" +
|
||||
"<td align=\"left\"><b title=\"")
|
||||
.append(_t("Your Local Identity is your unique I2P router identity, similar to an ip address but tailored to I2P. "))
|
||||
.append(_t("Never disclose this to anyone, as it can reveal your real world ip."))
|
||||
.append("\">")
|
||||
.append(_t("Local Identity"))
|
||||
.append(":</b></td>" +
|
||||
"<td align=\"right\">" +
|
||||
"<a title=\"")
|
||||
.append(_t("Your unique I2P router identity is"))
|
||||
.append(' ')
|
||||
.append(_helper.getIdent())
|
||||
.append(", ")
|
||||
.append(_t("never reveal it to anyone"))
|
||||
.append("\" href=\"/netdb?r=.\" target=\"_top\">")
|
||||
.append(_t("show"))
|
||||
.append("</a></td></tr>\n" +
|
||||
|
||||
"</table><table id=\"sb_version\">" + // fix for some rows with a big left side and some with a big right side
|
||||
"</table><table id=\"sb_general\">" +
|
||||
"<tr title=\"")
|
||||
.append(_t("The version of the I2P software we are running"))
|
||||
.append("\">" +
|
||||
@ -353,7 +414,6 @@ class SummaryBarRenderer {
|
||||
.append(_helper.getVersion())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"</table><table id=\"sb_uptime\">" + // fix for some rows with a big left side and some with a big right side
|
||||
"<tr title=\"")
|
||||
.append(_t("How long we've been running for this session"))
|
||||
.append("\">" +
|
||||
@ -366,7 +426,7 @@ class SummaryBarRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String renderShortGeneralHTML() {
|
||||
public String renderShortRouterInfoHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
buf.append("<table id=\"sb_shortgeneral\">" +
|
||||
@ -392,12 +452,80 @@ class SummaryBarRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** @since 0.9.32 */
|
||||
public String renderAdvancedRouterInfoHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
buf.append("<h3><a href=\"/netdb?r=.\" target=\"_top\" title=\"")
|
||||
.append(_t("Your Local Identity [{0}] is your unique I2P router identity, similar to an IP address but tailored to I2P. ", _helper.getIdent()))
|
||||
.append(_t("Never disclose this to anyone, as it can reveal your real world IP."))
|
||||
.append("\">")
|
||||
.append(_t("Router Info"))
|
||||
.append("</a></h3><hr class=\"b\">\n" +
|
||||
|
||||
"<table id=\"sb_advancedgeneral\">" +
|
||||
"<tr title=\"")
|
||||
.append(_t("The version of the I2P software we are running"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Version"))
|
||||
.append(":</b></td>" +
|
||||
"<td align=\"right\">")
|
||||
.append(_helper.getVersion())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("How long we've been running for this session"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Uptime"))
|
||||
.append(":</b></td>" +
|
||||
"<td align=\"right\">")
|
||||
.append(_helper.getUptime())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("Difference between network-synced time and local time"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Clock Skew"))
|
||||
.append(":</b></td>" +
|
||||
"<td align=\"right\">")
|
||||
.append(_context.clock().getOffset())
|
||||
.append(" ms</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("How much RAM I2P is using / total RAM available to I2P (excludes RAM allocated to the JVM)"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Memory"))
|
||||
.append(":</b></td>" +
|
||||
"<td align=\"right\">")
|
||||
.append(_helper.getMemory())
|
||||
.append("</td></tr></table>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** @since 0.9.32 */
|
||||
public String renderMemoryBarHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
buf.append(_helper.getMemoryBar());
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String renderNetworkReachabilityHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
SummaryHelper.NetworkStateMessage reachability = _helper.getReachability();
|
||||
buf.append("<h4><span class=\"");
|
||||
buf.append("<h4><span class=\"sb_netstatus ");
|
||||
switch (reachability.getState()) {
|
||||
case VMCOMM:
|
||||
buf.append("vmcomm");
|
||||
break;
|
||||
case CLOCKSKEW:
|
||||
buf.append("clockskew");
|
||||
break;
|
||||
case ERROR:
|
||||
buf.append("error");
|
||||
break;
|
||||
@ -528,6 +656,90 @@ class SummaryBarRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String renderPeersAdvancedHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
buf.append("<h3><a href=\"/peers\" target=\"_top\" title=\"")
|
||||
.append(_t("Show all current peer connections"))
|
||||
.append("\">")
|
||||
.append(_t("Peers"))
|
||||
.append("</a></h3><hr class=\"b\">\n" +
|
||||
|
||||
"<table id=\"sb_peersadvanced\">\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("Peers we've been talking to in the last few minutes/last hour"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Active"))
|
||||
.append(":</b></td><td align=\"right\">");
|
||||
int active = _helper.getActivePeers();
|
||||
buf.append(active)
|
||||
.append(SummaryHelper.THINSP)
|
||||
.append(Math.max(active, _helper.getActiveProfiles()))
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The number of peers available for building client tunnels"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Fast"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getFastPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The number of peers available for building exploratory tunnels"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("High capacity"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getHighCapacityPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The number of peers available for network database inquiries"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Integrated"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getWellIntegratedPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The total number of peers in our network database"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><b>")
|
||||
.append(_t("Known"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getAllPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr class=\"separator\"><td colspan=\"2\"><hr></td></tr>" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The number of peers failing network tests"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><a href=\"/profiles\"><b>")
|
||||
.append(_t("Failing"))
|
||||
.append(":</b></a></td><td align=\"right\">")
|
||||
.append(_helper.getFailingPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr title=\"")
|
||||
.append(_t("The number of banned peers"))
|
||||
.append("\">" +
|
||||
"<td align=\"left\"><a href=\"/profiles?f=3\"><b>")
|
||||
.append(_t("Banned"))
|
||||
.append(":</b></a></td><td align=\"right\">")
|
||||
.append(_helper. getBanlistedPeers())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"</table>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
public String renderFirewallAndReseedStatusHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
@ -579,6 +791,21 @@ class SummaryBarRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** @since 0.9.32 */
|
||||
public String renderBandwidthGraphHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
if (!StatSummarizer.isDisabled())
|
||||
buf.append("<div id=\"sb_graphcontainer\"><a href=\"/graphs\"><table id=\"sb_bandwidthgraph\">" +
|
||||
"<tr title=\"")
|
||||
.append(_t("Our inbound & outbound traffic for the last 20 minutes"))
|
||||
.append("\"><td><span id=\"sb_graphstats\">")
|
||||
.append(_helper.getSecondKBps())
|
||||
.append("Bps</span></td></tr></table></a></div>\n");
|
||||
// .append("<script src=\"/js/refreshGraph.js\" type=\"text/javascript\"></script>");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String renderTunnelsHTML() {
|
||||
if (_helper == null) return "";
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
|
@ -30,7 +30,7 @@ import net.i2p.util.PortMapper;
|
||||
|
||||
/**
|
||||
* Simple helper to query the appropriate router for data necessary to render
|
||||
* the summary sections on the router console.
|
||||
* the summary sections on the router console.
|
||||
*
|
||||
* For the full summary bar use renderSummaryBar()
|
||||
*/
|
||||
@ -43,14 +43,14 @@ public class SummaryHelper extends HelperBase {
|
||||
static final String PROP_SUMMARYBAR = "routerconsole.summaryBar.";
|
||||
|
||||
static final String DEFAULT_FULL =
|
||||
"HelpAndFAQ" + S +
|
||||
"ShortGeneral" + S +
|
||||
"RouterInfo" + S +
|
||||
"UpdateStatus" + S +
|
||||
"Bandwidth" + S +
|
||||
"NetworkReachability" + S +
|
||||
"FirewallAndReseedStatus" + S +
|
||||
"I2PServices" + S +
|
||||
"I2PInternals" + S +
|
||||
"HelpAndFAQ" + S +
|
||||
"Peers" + S +
|
||||
"Tunnels" + S +
|
||||
"TunnelStatus" + S +
|
||||
@ -59,8 +59,8 @@ public class SummaryHelper extends HelperBase {
|
||||
"";
|
||||
|
||||
static final String DEFAULT_FULL_ADVANCED =
|
||||
"HelpAndFAQ" + S +
|
||||
"ShortGeneral" + S +
|
||||
"AdvancedRouterInfo" + S +
|
||||
"MemoryBar" + S +
|
||||
"UpdateStatus" + S +
|
||||
"Bandwidth" + S +
|
||||
"NetworkReachability" + S +
|
||||
@ -77,7 +77,20 @@ public class SummaryHelper extends HelperBase {
|
||||
"";
|
||||
|
||||
static final String DEFAULT_MINIMAL =
|
||||
"ShortGeneral" + S +
|
||||
"ShortRouterInfo" + S +
|
||||
"Bandwidth" + S +
|
||||
"UpdateStatus" + S +
|
||||
"NewsHeadings" + S +
|
||||
"NetworkReachability" + S +
|
||||
"FirewallAndReseedStatus" + S +
|
||||
"RestartStatus" + S +
|
||||
"Destinations" + S +
|
||||
"";
|
||||
|
||||
/** @since 0.9.32 */
|
||||
static final String DEFAULT_MINIMAL_ADVANCED =
|
||||
"AdvancedRouterInfo" + S +
|
||||
"MemoryBar" + S +
|
||||
"Bandwidth" + S +
|
||||
"UpdateStatus" + S +
|
||||
"NewsHeadings" + S +
|
||||
@ -152,7 +165,9 @@ public class SummaryHelper extends HelperBase {
|
||||
FIREWALLED,
|
||||
RUNNING,
|
||||
WARN,
|
||||
ERROR;
|
||||
ERROR,
|
||||
CLOCKSKEW,
|
||||
VMCOMM;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +212,7 @@ public class SummaryHelper extends HelperBase {
|
||||
|
||||
private NetworkStateMessage reachability() {
|
||||
if (_context.commSystem().isDummy())
|
||||
return new NetworkStateMessage(NetworkState.RUNNING, "VM Comm System");
|
||||
return new NetworkStateMessage(NetworkState.VMCOMM, "VM Comm System");
|
||||
if (_context.router().getUptime() > 60*1000 && (!_context.router().gracefulShutdownInProgress()) &&
|
||||
!_context.clientManager().isAlive())
|
||||
return new NetworkStateMessage(NetworkState.ERROR, _t("ERR-Client Manager I2CP Error - check logs")); // not a router problem but the user should know
|
||||
@ -207,7 +222,7 @@ public class SummaryHelper extends HelperBase {
|
||||
long skew = _context.commSystem().getFramedAveragePeerClockSkew(33);
|
||||
// Display the actual skew, not the offset
|
||||
if (Math.abs(skew) > 30*1000)
|
||||
return new NetworkStateMessage(NetworkState.ERROR, _t("ERR-Clock Skew of {0}", DataHelper.formatDuration2(Math.abs(skew))));
|
||||
return new NetworkStateMessage(NetworkState.CLOCKSKEW, _t("ERR-Clock Skew of {0}", DataHelper.formatDuration2(Math.abs(skew))));
|
||||
if (_context.router().isHidden())
|
||||
return new NetworkStateMessage(NetworkState.HIDDEN, _t("Hidden"));
|
||||
RouterInfo routerInfo = _context.router().getRouterInfo();
|
||||
@ -281,21 +296,37 @@ public class SummaryHelper extends HelperBase {
|
||||
* Retrieve amount of used memory.
|
||||
*
|
||||
*/
|
||||
/********
|
||||
|
||||
public String getMemory() {
|
||||
DecimalFormat integerFormatter = new DecimalFormat("###,###,##0");
|
||||
long used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024;
|
||||
long used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024/1024;
|
||||
long usedPc = 100 - ((Runtime.getRuntime().freeMemory() * 100) / Runtime.getRuntime().totalMemory());
|
||||
return integerFormatter.format(used) + "KB (" + usedPc + "%)";
|
||||
long total = (Runtime.getRuntime().totalMemory())/1024/1024;
|
||||
// long free = Runtime.getRuntime().freeMemory()/1024/1024;
|
||||
// return integerFormatter.format(used) + "MB (" + usedPc + "%)";
|
||||
// return integerFormatter.format(used) + "MB / " + free + " MB";
|
||||
return integerFormatter.format(used) + " / " + total + "MB";
|
||||
}
|
||||
|
||||
public String getMemoryBar() {
|
||||
DecimalFormat integerFormatter = new DecimalFormat("###,###,##0");
|
||||
long used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024/1024;
|
||||
long usedPc = 100 - ((Runtime.getRuntime().freeMemory() * 100) / Runtime.getRuntime().totalMemory());
|
||||
long total = (Runtime.getRuntime().totalMemory())/1024/1024;
|
||||
// long free = Runtime.getRuntime().freeMemory()/1024/1024;
|
||||
// return integerFormatter.format(used) + "MB (" + usedPc + "%)";
|
||||
// return integerFormatter.format(used) + "MB / " + free + " MB";
|
||||
return "<div class=\"percentBarOuter\"><div class=\"percentBarText\">RAM: " + integerFormatter.format(used) + " / " + total + "MB" +
|
||||
"</div><div class=\"percentBarInner\" style=\"width: " + integerFormatter.format(usedPc) +
|
||||
"%;\"></div></div>";
|
||||
}
|
||||
********/
|
||||
|
||||
/**
|
||||
* How many peers we are talking to now
|
||||
*
|
||||
*/
|
||||
public int getActivePeers() {
|
||||
if (_context == null)
|
||||
public int getActivePeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.commSystem().countActivePeers();
|
||||
@ -305,7 +336,7 @@ public class SummaryHelper extends HelperBase {
|
||||
* Should we warn about a possible firewall problem?
|
||||
*/
|
||||
public boolean showFirewallWarning() {
|
||||
return _context != null &&
|
||||
return _context != null &&
|
||||
_context.netDb().isInitialized() &&
|
||||
_context.router().getUptime() > 2*60*1000 &&
|
||||
(!_context.commSystem().isDummy()) &&
|
||||
@ -317,8 +348,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active identities have we spoken with recently
|
||||
*
|
||||
*/
|
||||
public int getActiveProfiles() {
|
||||
if (_context == null)
|
||||
public int getActiveProfiles() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.profileOrganizer().countActivePeers();
|
||||
@ -327,8 +358,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active peers the router ranks as fast.
|
||||
*
|
||||
*/
|
||||
public int getFastPeers() {
|
||||
if (_context == null)
|
||||
public int getFastPeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.profileOrganizer().countFastPeers();
|
||||
@ -337,8 +368,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active peers the router ranks as having a high capacity.
|
||||
*
|
||||
*/
|
||||
public int getHighCapacityPeers() {
|
||||
if (_context == null)
|
||||
public int getHighCapacityPeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.profileOrganizer().countHighCapacityPeers();
|
||||
@ -347,8 +378,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active peers the router ranks as well integrated.
|
||||
*
|
||||
*/
|
||||
public int getWellIntegratedPeers() {
|
||||
if (_context == null)
|
||||
public int getWellIntegratedPeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
//return _context.profileOrganizer().countWellIntegratedPeers();
|
||||
return _context.peerManager().getPeersByCapability(FloodfillNetworkDatabaseFacade.CAPABILITY_FLOODFILL).size();
|
||||
@ -357,34 +388,34 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many peers the router ranks as failing.
|
||||
*
|
||||
*/
|
||||
/********
|
||||
public int getFailingPeers() {
|
||||
if (_context == null)
|
||||
|
||||
public int getFailingPeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.profileOrganizer().countFailingPeers();
|
||||
}
|
||||
********/
|
||||
|
||||
/**
|
||||
* How many peers totally suck.
|
||||
*
|
||||
*/
|
||||
/********
|
||||
public int getBanlistedPeers() {
|
||||
if (_context == null)
|
||||
|
||||
public int getBanlistedPeers() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.banlist().getRouterCount();
|
||||
}
|
||||
********/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return "x.xx / y.yy {K|M}"
|
||||
*/
|
||||
public String getSecondKBps() {
|
||||
if (_context == null)
|
||||
public String getSecondKBps() {
|
||||
if (_context == null)
|
||||
return "0 / 0";
|
||||
return formatPair(_context.bandwidthLimiter().getReceiveBps(),
|
||||
return formatPair(_context.bandwidthLimiter().getReceiveBps(),
|
||||
_context.bandwidthLimiter().getSendBps());
|
||||
}
|
||||
|
||||
@ -392,7 +423,7 @@ public class SummaryHelper extends HelperBase {
|
||||
* @return "x.xx / y.yy {K|M}"
|
||||
*/
|
||||
public String getFiveMinuteKBps() {
|
||||
if (_context == null)
|
||||
if (_context == null)
|
||||
return "0 / 0";
|
||||
|
||||
RateStat receiveRate = _context.statManager().getRate("bw.recvRate");
|
||||
@ -415,8 +446,8 @@ public class SummaryHelper extends HelperBase {
|
||||
/**
|
||||
* @return "x.xx / y.yy {K|M}"
|
||||
*/
|
||||
public String getLifetimeKBps() {
|
||||
if (_context == null)
|
||||
public String getLifetimeKBps() {
|
||||
if (_context == null)
|
||||
return "0 / 0";
|
||||
|
||||
RateStat receiveRate = _context.statManager().getRate("bw.recvRate");
|
||||
@ -464,8 +495,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
|
||||
*
|
||||
*/
|
||||
public String getInboundTransferred() {
|
||||
if (_context == null)
|
||||
public String getInboundTransferred() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
|
||||
long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes();
|
||||
@ -478,8 +509,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
|
||||
*
|
||||
*/
|
||||
public String getOutboundTransferred() {
|
||||
if (_context == null)
|
||||
public String getOutboundTransferred() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
|
||||
long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
|
||||
@ -529,7 +560,7 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"").append(_t("Rebuilding")).append("…\" title=\"").append(_t("Leases expired")).append(" ").append(DataHelper.formatDuration2(0-timeToExpire));
|
||||
buf.append(" ").append(_t("ago")).append(". ").append(_t("Rebuilding")).append("…\"></td></tr>\n");
|
||||
} else {
|
||||
// green light
|
||||
// green light
|
||||
buf.append("<td><img src=\"/themes/console/images/local_up.png\" alt=\"Ready\" title=\"").append(_t("Ready")).append("\"></td></tr>\n");
|
||||
}
|
||||
} else {
|
||||
@ -585,8 +616,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many free inbound tunnels we have.
|
||||
*
|
||||
*/
|
||||
public int getInboundTunnels() {
|
||||
if (_context == null)
|
||||
public int getInboundTunnels() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.tunnelManager().getFreeTunnelCount();
|
||||
@ -596,8 +627,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active outbound tunnels we have.
|
||||
*
|
||||
*/
|
||||
public int getOutboundTunnels() {
|
||||
if (_context == null)
|
||||
public int getOutboundTunnels() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.tunnelManager().getOutboundTunnelCount();
|
||||
@ -607,8 +638,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many inbound client tunnels we have.
|
||||
*
|
||||
*/
|
||||
public int getInboundClientTunnels() {
|
||||
if (_context == null)
|
||||
public int getInboundClientTunnels() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.tunnelManager().getInboundClientTunnelCount();
|
||||
@ -618,8 +649,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many active outbound client tunnels we have.
|
||||
*
|
||||
*/
|
||||
public int getOutboundClientTunnels() {
|
||||
if (_context == null)
|
||||
public int getOutboundClientTunnels() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.tunnelManager().getOutboundClientTunnelCount();
|
||||
@ -629,16 +660,16 @@ public class SummaryHelper extends HelperBase {
|
||||
* How many tunnels we are participating in.
|
||||
*
|
||||
*/
|
||||
public int getParticipatingTunnels() {
|
||||
if (_context == null)
|
||||
public int getParticipatingTunnels() {
|
||||
if (_context == null)
|
||||
return 0;
|
||||
else
|
||||
return _context.tunnelManager().getParticipatingCount();
|
||||
}
|
||||
|
||||
/** @since 0.7.10 */
|
||||
public String getShareRatio() {
|
||||
if (_context == null)
|
||||
public String getShareRatio() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
double sr = _context.tunnelManager().getShareRatio();
|
||||
DecimalFormat fmt = new DecimalFormat("##0.00");
|
||||
@ -650,8 +681,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* the units attached)
|
||||
*
|
||||
*/
|
||||
public String getJobLag() {
|
||||
if (_context == null)
|
||||
public String getJobLag() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
|
||||
RateStat rs = _context.statManager().getRate("jobQueue.jobLag");
|
||||
@ -666,8 +697,8 @@ public class SummaryHelper extends HelperBase {
|
||||
* (pretty printed with the units attached)
|
||||
*
|
||||
*/
|
||||
public String getMessageDelay() {
|
||||
if (_context == null)
|
||||
public String getMessageDelay() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
|
||||
return DataHelper.formatDuration2(_context.throttle().getMessageDelay());
|
||||
@ -678,15 +709,15 @@ public class SummaryHelper extends HelperBase {
|
||||
* (pretty printed with the units attached)
|
||||
*
|
||||
*/
|
||||
public String getTunnelLag() {
|
||||
if (_context == null)
|
||||
public String getTunnelLag() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
|
||||
return DataHelper.formatDuration2(_context.throttle().getTunnelLag());
|
||||
}
|
||||
|
||||
public String getTunnelStatus() {
|
||||
if (_context == null)
|
||||
public String getTunnelStatus() {
|
||||
if (_context == null)
|
||||
return "";
|
||||
return _context.throttle().getTunnelStatus();
|
||||
}
|
||||
@ -722,30 +753,30 @@ public class SummaryHelper extends HelperBase {
|
||||
}
|
||||
********/
|
||||
|
||||
private static boolean updateAvailable() {
|
||||
private static boolean updateAvailable() {
|
||||
return NewsHelper.isUpdateAvailable();
|
||||
}
|
||||
|
||||
private boolean unsignedUpdateAvailable() {
|
||||
private boolean unsignedUpdateAvailable() {
|
||||
return NewsHelper.isUnsignedUpdateAvailable(_context);
|
||||
}
|
||||
|
||||
/** @since 0.9.20 */
|
||||
private boolean devSU3UpdateAvailable() {
|
||||
private boolean devSU3UpdateAvailable() {
|
||||
return NewsHelper.isDevSU3UpdateAvailable(_context);
|
||||
}
|
||||
|
||||
private static String getUpdateVersion() {
|
||||
private static String getUpdateVersion() {
|
||||
return DataHelper.escapeHTML(NewsHelper.updateVersion());
|
||||
}
|
||||
|
||||
private static String getUnsignedUpdateVersion() {
|
||||
private static String getUnsignedUpdateVersion() {
|
||||
// value is a formatted date, does not need escaping
|
||||
return NewsHelper.unsignedUpdateVersion();
|
||||
}
|
||||
|
||||
/** @since 0.9.20 */
|
||||
private static String getDevSU3UpdateVersion() {
|
||||
private static String getDevSU3UpdateVersion() {
|
||||
return DataHelper.escapeHTML(NewsHelper.devSU3UpdateVersion());
|
||||
}
|
||||
|
||||
@ -759,7 +790,7 @@ public class SummaryHelper extends HelperBase {
|
||||
String status = NewsHelper.getUpdateStatus();
|
||||
boolean needSpace = false;
|
||||
if (status.length() > 0) {
|
||||
buf.append("<h4 class=\"sb_info\">").append(status).append("</h4>\n");
|
||||
buf.append("<h4 class=\"sb_info sb_update\">").append(status).append("</h4>\n");
|
||||
needSpace = true;
|
||||
}
|
||||
String dver = NewsHelper.updateVersionDownloaded();
|
||||
@ -775,7 +806,7 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("<hr>");
|
||||
else
|
||||
needSpace = true;
|
||||
buf.append("<h4 class=\"sb_info\"><b>").append(_t("Update downloaded")).append("<br>");
|
||||
buf.append("<h4 class=\"sb_info sb_update\"><b>").append(_t("Update downloaded")).append("<br>");
|
||||
if (_context.hasWrapper())
|
||||
buf.append(_t("Click Restart to install"));
|
||||
else
|
||||
@ -796,7 +827,7 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("<hr>");
|
||||
else
|
||||
needSpace = true;
|
||||
buf.append("<h4 class=\"sb_info\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append("<h4 class=\"sb_info sb_update\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append(_t("Version {0}", getUpdateVersion())).append("<br>");
|
||||
buf.append(constraint).append("</b></h4>");
|
||||
avail = false;
|
||||
@ -808,7 +839,7 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("<hr>");
|
||||
else
|
||||
needSpace = true;
|
||||
buf.append("<h4 class=\"sb_info\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append("<h4 class=\"sb_info sb_update\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append(_t("Version {0}", getUnsignedUpdateVersion())).append("<br>");
|
||||
buf.append(unsignedConstraint).append("</b></h4>");
|
||||
unsignedAvail = false;
|
||||
@ -820,7 +851,7 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("<hr>");
|
||||
else
|
||||
needSpace = true;
|
||||
buf.append("<h4 class=\"sb_info\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append("<h4 class=\"sb_info sb_update\"><b>").append(_t("Update available")).append(":<br>");
|
||||
buf.append(_t("Version {0}", getDevSU3UpdateVersion())).append("<br>");
|
||||
buf.append(devSU3Constraint).append("</b></h4>");
|
||||
devSU3Avail = false;
|
||||
@ -930,7 +961,7 @@ public class SummaryHelper extends HelperBase {
|
||||
public List<String> getSummaryBarSections(String page) {
|
||||
String config = "";
|
||||
if ("home".equals(page)) {
|
||||
config = _context.getProperty(PROP_SUMMARYBAR + page, DEFAULT_MINIMAL);
|
||||
config = _context.getProperty(PROP_SUMMARYBAR + page, isAdvanced() ? DEFAULT_MINIMAL_ADVANCED : DEFAULT_MINIMAL);
|
||||
} else {
|
||||
config = _context.getProperty(PROP_SUMMARYBAR + page);
|
||||
if (config == null)
|
||||
@ -982,6 +1013,16 @@ public class SummaryHelper extends HelperBase {
|
||||
List<String> sections = getSummaryBarSections("default");
|
||||
TreeSet<String> sortedSections = new TreeSet<String>();
|
||||
|
||||
// Forward-convert old section names
|
||||
int pos = sections.indexOf("General");
|
||||
if (pos >= 0) {
|
||||
sections.set(pos, "RouterInfo");
|
||||
}
|
||||
pos = sections.indexOf("ShortGeneral");
|
||||
if (pos >= 0) {
|
||||
sections.set(pos, "ShortRouterInfo");
|
||||
}
|
||||
|
||||
for (int i = 0; i < allSections.length; i++) {
|
||||
String section = allSections[i];
|
||||
if (!sections.contains(section))
|
||||
|
@ -266,7 +266,7 @@ class SummaryRenderer {
|
||||
def.area(dsNames[0], AREA_COLOR, _listener.getRate().getRateStat().getDescription());
|
||||
def.line(dsNames[1], LINE_COLOR, "Events per period");
|
||||
*/
|
||||
if (hideLegend)
|
||||
if (hideLegend)
|
||||
def.setNoLegend(true);
|
||||
if (hideGrid) {
|
||||
def.setDrawXGrid(false);
|
||||
|
Reference in New Issue
Block a user