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 7b27a46ff..9dde3f8a1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java @@ -38,6 +38,7 @@ public class GraphHelper extends FormHandler { public static final int DEFAULT_Y = 100; private static final int DEFAULT_REFRESH = 5*60; private static final int DEFAULT_PERIODS = 60; + private static final boolean DEFAULT_LEGEND = false; static final int MAX_X = 2048; static final int MAX_Y = 1024; private static final int MIN_X = 200; @@ -55,7 +56,6 @@ public class GraphHelper extends FormHandler { _periodCount = _context.getProperty(PROP_PERIODS, DEFAULT_PERIODS); _refreshDelaySeconds = _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH); _showEvents = _context.getBooleanProperty(PROP_EVENTS); - _graphHideLegend = _context.getBooleanProperty(PROP_LEGEND); } /** @@ -158,6 +158,7 @@ public class GraphHelper extends FormHandler { if (title.equals("bw.sendRate")) hasTx = true; else if (title.equals("bw.recvRate")) hasRx = true; } + boolean hideLegend = _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND); if (hasTx && hasRx && !_showEvents) { _out.write("\n"); } @@ -202,7 +203,7 @@ public class GraphHelper extends FormHandler { + "&periodCount=" + _periodCount + "&width=" + _width + "&height=" + _height - + "&hideLegend=" + _graphHideLegend + + "&hideLegend=" + hideLegend + "\" alt=\"" + title + "\" title=\"" + title + "\">\n"); } @@ -252,6 +253,7 @@ public class GraphHelper extends FormHandler { if (_end > 0) _out.write(' ' + _t("ending {0} ago", DataHelper.formatDuration2(_end * period))); + boolean hideLegend = _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND); _out.write(" [" + _t("Return to main graphs page") + "]\n" + "

\n"); if (_width < MAX_X && _height < MAX_Y) { @@ -372,21 +374,18 @@ public class GraphHelper extends FormHandler { try { _out.write("

" + _t("Configure Graph Display") + " [" + _t("Select Stats") + "]

"); _out.write("
\n" + - "
\n" + + "
\n" + "\n"); - _out.write(_t("Display period") + ":
" + _t("minutes") + "
\n"); - _out.write(_t("Plot type") + ":"); - _out.write("   "); - _out.write ("
\n"); - _out.write(_t("Graph size") + ":"); + _out.write(_t("Graph size") + ": " + _t("pixels wide") + "   " + _t("pixels high") + "" + _t("Note: Dimensions are for graph only (excludes title, labels and legend).") + "
\n"); - _out.write(_t("Hide legend") + ":"); - _out.write("
\n"); - _out.write(_t("Refresh delay") + ":" + _t("minutes") + "
\n"); + + + _out.write(_t("Refresh delay") + ":
\n" + _t("Persistence") + - ":
" + + _out.write(">" + _t("Store graph data on disk") + "
" + "
"); } catch (IOException ioe) { ioe.printStackTrace(); @@ -453,7 +463,7 @@ public class GraphHelper extends FormHandler { _periodCount != _context.getProperty(PROP_PERIODS, DEFAULT_PERIODS) || _refreshDelaySeconds != _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH) || _showEvents != _context.getBooleanProperty(PROP_EVENTS) || - _graphHideLegend != _context.getBooleanProperty(PROP_LEGEND) || + _graphHideLegend != _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND) || _persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT)) { Map changes = new HashMap(); changes.put(PROP_X, "" + _width); diff --git a/history.txt b/history.txt index bdeef3ecd..afdb70a57 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,9 @@ +2017-11-03 str4d + * Console: + - /graphs: + - Reorganised config form + - Fixed "hide legends" option + 2017-11-02 str4d * Console: - Sidebar: