diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java index 55a854900..ef81a92d2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java @@ -17,6 +17,7 @@ public class GraphHelper extends FormHandler { private int _width; private int _height; private int _refreshDelaySeconds; + private boolean _persistent; private static final String PROP_X = "routerconsole.graphX"; private static final String PROP_Y = "routerconsole.graphY"; @@ -39,9 +40,21 @@ public class GraphHelper extends FormHandler { _height = _context.getProperty(PROP_Y, DEFAULT_Y); _periodCount = _context.getProperty(PROP_PERIODS, DEFAULT_PERIODS); _refreshDelaySeconds = _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH); - _showEvents = Boolean.valueOf(_context.getProperty(PROP_EVENTS)).booleanValue(); + _showEvents = _context.getBooleanProperty(PROP_EVENTS); } + /** + * This must be output in the jsp since must be in the
+ * @since 0.8.6 + */ + public String getRefreshMeta() { + if (_refreshDelaySeconds <= 8 || + ConfigRestartBean.getRestartTimeRemaining() < (1000 * (_refreshDelaySeconds + 30))) + return ""; + // shorten the refresh by 3 seconds so we beat the iframe + return ""; + } + /** * This was a HelperBase but now it's a FormHandler * @since 0.8.2 @@ -51,13 +64,17 @@ public class GraphHelper extends FormHandler { public void setPeriodCount(String str) { try { _periodCount = Integer.parseInt(str); } catch (NumberFormatException nfe) {} } + public void setShowEvents(boolean b) { _showEvents = b; } + public void setHeight(String str) { try { _height = Math.min(Integer.parseInt(str), MAX_Y); } catch (NumberFormatException nfe) {} } + public void setWidth(String str) { try { _width = Math.min(Integer.parseInt(str), MAX_X); } catch (NumberFormatException nfe) {} } + public void setRefreshDelay(String str) { try { int rds = Integer.parseInt(str); @@ -67,6 +84,9 @@ public class GraphHelper extends FormHandler { _refreshDelaySeconds = -1; } catch (NumberFormatException nfe) {} } + + /** @since 0.8.6 */ + public void setPersistent(String foo) { _persistent = true; } public String getImages() { try { @@ -123,13 +143,9 @@ public class GraphHelper extends FormHandler { + "\" alt=\"" + title + "\" title=\"" + title + "\">\n"); } - // FIXME not allowed inside" + _("All times are UTC.") + "
\n"); + _out.write("" + _("All times are UTC.") + "
\n"); } catch (IOException ioe) { ioe.printStackTrace(); } @@ -148,11 +164,11 @@ public class GraphHelper extends FormHandler { _out.write(""); + _("Store graph data on disk?") + + " " + + "