From b8f5c956e6c0677e663987f5dfb579f84e0ab78c Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 25 Jul 2017 10:13:36 +0000 Subject: [PATCH 01/32] Console: Move JRobin default color and font changes into SummaryRenderer This ensures these changes are applied to Debian installs, where we get JRobin from the package manager instead of our bundled source. The padding and grid stroke changes to RrdGraphConstants have not been reverted, because there is no API provided to alter those values. This will result in a minor difference between Debian and non-Debian graphs, and if a user shares those graphs, it will reveal the fact that they have installed the Debian package. This is acceptable, given that the graphs themselves inherently reveal significantly more private information than that. --- .../src/org/jrobin/graph/RrdGraphConstants.java | 6 +++--- .../java/src/org/jrobin/graph/RrdGraphDef.java | 12 ++++++------ .../src/net/i2p/router/web/SummaryRenderer.java | 14 ++++++++++++++ history.txt | 3 +++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/apps/jrobin/java/src/org/jrobin/graph/RrdGraphConstants.java b/apps/jrobin/java/src/org/jrobin/graph/RrdGraphConstants.java index a46508436..939670c20 100644 --- a/apps/jrobin/java/src/org/jrobin/graph/RrdGraphConstants.java +++ b/apps/jrobin/java/src/org/jrobin/graph/RrdGraphConstants.java @@ -161,12 +161,12 @@ public interface RrdGraphConstants { /** * Default minor grid color */ - Color DEFAULT_GRID_COLOR = new Color(100, 100, 100, 75); + Color DEFAULT_GRID_COLOR = new Color(171, 171, 171, 95); // Color DEFAULT_GRID_COLOR = new Color(140, 140, 140); /** * Default major grid color */ - Color DEFAULT_MGRID_COLOR = new Color(255, 91, 91, 110); + Color DEFAULT_MGRID_COLOR = new Color(255, 91, 91, 95); // Color DEFAULT_MGRID_COLOR = new Color(130, 30, 30); /** * Default font color @@ -251,7 +251,7 @@ public interface RrdGraphConstants { * Default font name, determined based on the current operating system */ String DEFAULT_FONT_NAME = System.getProperty("os.name").toLowerCase().contains("windows") ? - "Lucida Console" : "Monospaced"; + "Lucida Sans Typewriter" : "Monospaced"; /** * Default graph small font diff --git a/apps/jrobin/java/src/org/jrobin/graph/RrdGraphDef.java b/apps/jrobin/java/src/org/jrobin/graph/RrdGraphDef.java index 2f1221cd0..6f4e966a3 100644 --- a/apps/jrobin/java/src/org/jrobin/graph/RrdGraphDef.java +++ b/apps/jrobin/java/src/org/jrobin/graph/RrdGraphDef.java @@ -132,11 +132,11 @@ public class RrdGraphDef implements RrdGraphConstants { fontDir = new File(fontdirProperty); } - fonts[FONTTAG_DEFAULT] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10); - fonts[FONTTAG_TITLE] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10); - fonts[FONTTAG_AXIS] = new Font("Droid Sans Mono", Font.PLAIN, 10); - fonts[FONTTAG_UNIT] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10); - fonts[FONTTAG_LEGEND] = new Font("Droid Sans Mono", Font.PLAIN, 10); + fonts[FONTTAG_DEFAULT] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8); + fonts[FONTTAG_TITLE] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 9); + fonts[FONTTAG_AXIS] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 7); + fonts[FONTTAG_UNIT] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8); + fonts[FONTTAG_LEGEND] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8); fonts[FONTTAG_WATERMARK] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 1).deriveFont(5.5F); } @@ -173,7 +173,7 @@ public class RrdGraphDef implements RrdGraphConstants { if (exception != null) { System.err.println(exception.getLocalizedMessage()); } - font = new Font("Monospaced", Font.PLAIN, 10); + font = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10); } if (font == null) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java index be16bf077..1a5bb960d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java @@ -35,9 +35,13 @@ class SummaryRenderer { private final Log _log; private final SummaryListener _listener; private final I2PAppContext _context; + private static final Color GRID_COLOR = new Color(100, 100, 100, 75); + private static final Color MGRID_COLOR = new Color(255, 91, 91, 110); private static final Color AREA_COLOR = new Color(100, 160, 200, 200); private static final Color LINE_COLOR = new Color(0, 30, 110, 255); private static final Color RESTART_BAR_COLOR = new Color(223, 13, 13, 255); + private static final String DEFAULT_FONT_NAME = System.getProperty("os.name").toLowerCase().contains("windows") ? + "Lucida Console" : "Monospaced"; public SummaryRenderer(I2PAppContext ctx, SummaryListener lsnr) { _log = ctx.logManager().getLog(SummaryRenderer.class); @@ -125,6 +129,16 @@ class SummaryRenderer { ImageOutputStream ios = null; try { RrdGraphDef def = new RrdGraphDef(); + + // Override defaults + def.setColor(RrdGraphDef.COLOR_GRID, GRID_COLOR); + def.setColor(RrdGraphDef.COLOR_MGRID, MGRID_COLOR); + def.setFont(RrdGraphDef.FONTTAG_DEFAULT, new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10)); + def.setFont(RrdGraphDef.FONTTAG_TITLE, new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10)); + def.setFont(RrdGraphDef.FONTTAG_AXIS, new Font("Droid Sans Mono", Font.PLAIN, 10)); + def.setFont(RrdGraphDef.FONTTAG_UNIT, new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10)); + def.setFont(RrdGraphDef.FONTTAG_LEGEND, new Font("Droid Sans Mono", Font.PLAIN, 10)); + // improve text legibility String lang = Messages.getLanguage(_context); Font small = def.getSmallFont(); diff --git a/history.txt b/history.txt index f164aaf95..8f1de20ad 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2017-07-25 str4d + * Console: Move JRobin default color and font changes into SummaryRenderer + 2017-07-15 zzz * Console: Fix compile error with Jetty 9.2.22 (ticket #2019) From 0feb16d57ba9fa1941251a7a1eb7cb9cb338277b Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 26 Jul 2017 20:46:54 +0000 Subject: [PATCH 02/32] history.txt: Tweak my older entries to fit 80 character per line limit This ensures the routerconsole changelog multi-column view doesn't wrap unnecessarily. --- history.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/history.txt b/history.txt index 8f1de20ad..c2a6bcaa7 100644 --- a/history.txt +++ b/history.txt @@ -48,13 +48,13 @@ - Each transport instance on own line - Better presentation of address characteristics - Place flag in table header - - Container div for leasesets to allow 2 column display at wider viewport width + - Container div for leasesets to allow responsive 2 column display - Increased spacing of lease information in leaseset tables - Add div for "not initialized" message - - Reorganize content display in sybil database to reduce horizontal whitespace: + - Reorganize content in sybil db to reduce horizontal whitespace: - Conditional 2-column display of sybil families - - Sybil router characteristics & threatpoints presented in multi-column view - - Added empty (n/a) fields to maintain visual consistency in column view + - Multi-column view for sybil router characteristics & threatpoints + - Empty (n/a) fields to maintain visual consistency in column view - /tunnels: - Tag "Local" for translation (and convert to lowercase in CSS) - Arabic: ensure our tunnel tables display correctly @@ -77,8 +77,8 @@ - Fix commenting out of forum.i2p where it impacts surrounding text - Cleanup unneeded CSS classes - Enhance Chinese legibility - - Add untagged strings for /tunnels tooltips and local tunnel indicator (to - be tagged for translation post .31 release) + - Add untagged strings for /tunnels tooltips and local tunnel indicator + (to be tagged for translation post .31 release) - classic: reduce color contrast of main display font - classic/dark/midnight: alignment on /peers and /tunnels - /tunnels: @@ -122,7 +122,7 @@ - Arabic (light) adjust font size for sidebar elements - Sidebar network status display (ticket #1996) - Usability: - - Enhance presentation of tables on /peers (improve header/column alignment, + - Enhance presentation of tables on /peers (header/column alignment, center to separator for multi-value rows) - Enhance presentation of tables on /tunnels (reliable alignment of mixed content in rows, more prominence to bandwidth tiers) From a39fb3d7c28f58cc1e5cfcbe6dbcf1e4adcc19c4 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 26 Jul 2017 22:03:08 +0000 Subject: [PATCH 03/32] I2PSnark: - Mitigate truncation of ratings dropdown in comments section (translations) - light: Reduce contrast of display text - light/classic: Increase contrast of download bars - Create Torrent trackers table: Replace "Tracker URL" with "Tracker Type" (ticket #1996) - Add a persistent warning to the messagelog when JavaScript is disabled to indicate potential loss of form data upon refresh (ticket #1996) - Migrate "view or change bandwidth" to [Configure] tooltip to standardize configuration links, allow for more space for option labels and lessen chance of option labels wrapping in translations --- .../org/klomp/snark/web/I2PSnarkServlet.java | 37 +- history.txt | 15 +- .../resources/themes/snark/classic/snark.css | 60 +- .../resources/themes/snark/dark/snark.css | 76 ++- .../resources/themes/snark/light/snark.css | 537 ++++++++++++------ .../resources/themes/snark/midnight/snark.css | 60 +- .../resources/themes/snark/ubergine/snark.css | 218 ++++++- .../resources/themes/snark/vanilla/snark.css | 76 ++- 8 files changed, 769 insertions(+), 310 deletions(-) diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index 56cdcfcc9..e9e3352b9 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -395,7 +395,7 @@ public class I2PSnarkServlet extends BasicServlet { List msgs = _manager.getMessages(); if (!msgs.isEmpty()) { out.write("\n
"); - out.write(" 0) @@ -407,6 +407,8 @@ public class I2PSnarkServlet extends BasicServlet { out.write(toThemeImg("delete", tx, tx)); out.write("" + "\n
    \n"); + out.write(""); for (int i = msgs.size()-1; i >= 0; i--) { String msg = msgs.get(i); out.write("
  • " + msg + "
  • \n"); @@ -2202,34 +2204,43 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\" name=\"foo\" >"); out.write("\n"); out.write(_t("Trackers")); - out.write(":
    "); + out.write(":\n"); for (Tracker t : sortedTrackers) { + List openTrackers = _manager.util().getOpenTrackers(); + List privateTrackers = _manager.getPrivateTrackers(); + boolean isPrivate = privateTrackers.contains(t.announceURL); + boolean isKnownOpen = _manager.util().isKnownOpenTracker(t.announceURL); + boolean isOpen = isKnownOpen || openTrackers.contains(t.announceURL); String name = t.name; String announceURL = t.announceURL.replace("=", "="); String homeURL = t.baseURL; - out.write("\n"); + out.write("\" value=\"foo\">
    Name"); out.write(_t("Primary")); out.write(""); out.write(_t("Alternates")); out.write(""); - out.write(_t("Tracker URL")); + out.write(_t("Tracker Type")); out.write("
    "); + out.write("
    "); out.write(name); - out.write(""); - out.write(homeURL); - out.write("
    "); + + if (!(isOpen || isPrivate)) + out.write(_t("Standard")); + if (isOpen) + out.write(_t("Open")); + if (isPrivate) { + out.write(_t("Private")); + } } - out.write("
    "); + out.write("
    "); out.write(_t("none")); out.write(" KBps "); out.write(_t("Half available bandwidth recommended.")); if (_context.isRouterContext()) { - out.write(" ["); + out.write(" ["); + out.write(_t("Configure")); out.write("]"); } out.write("\n