From fadda4ceec597b2e6395f60f2eb030e7ce3fcce2 Mon Sep 17 00:00:00 2001
From: z3d <z3d@mail.i2p>
Date: Sat, 17 Oct 2009 23:34:38 +0000
Subject: [PATCH] More UI whitespace cleanups and other miscellaneous UI
 goodness.

---
 .../router/web/ProfileOrganizerRenderer.java  |  4 +-
 apps/routerconsole/jsp/help.jsp               |  2 +-
 apps/routerconsole/jsp/jobs.jsp               |  2 +-
 apps/routerconsole/jsp/summary.jsp            |  4 +-
 apps/routerconsole/jsp/summaryframe.jsp       |  8 ++--
 .../themes/console/classic/console.css        | 38 ++++++++++++++++---
 .../resources/themes/console/dark/console.css |  6 +++
 .../themes/console/light/console.css          |  6 +++
 .../router/transport/ntcp/NTCPTransport.java  |  6 +--
 .../router/transport/udp/UDPTransport.java    |  2 +-
 10 files changed, 59 insertions(+), 19 deletions(-)

diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java
index f0f44c4c19..957cafc108 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java
@@ -226,9 +226,9 @@ class ProfileOrganizerRenderer {
         buf.append("</table>");
 
         buf.append("<h3>Thresholds:</h3>");
-        buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br>");
+        buf.append("<p><b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br>");
         buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br>");
-        buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)");
+        buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)</p>");
         buf.append("<h3>Definitions:</h3><ul>" +
                    "<li><b>groups</b>: as determined by the profile organizer</li>" +
                    "<li><b>caps</b>: capabilities in the netDb, not used to determine profiles</li>" +
diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp
index 01301649e9..ac945604a9 100644
--- a/apps/routerconsole/jsp/help.jsp
+++ b/apps/routerconsole/jsp/help.jsp
@@ -165,7 +165,7 @@ details on other applications available, as well as their licenses, please see t
 client applications can be found on our <a href="http://www.i2p2.i2p/download">download page</a>.
 .</p>
 
-<h2>Release history</h2>
+<h2>Release history</h2><br>
  <jsp:useBean class="net.i2p.router.web.ContentHelper" id="contenthelper" scope="request" />
  <% java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "history.txt"); %>
  <jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
diff --git a/apps/routerconsole/jsp/jobs.jsp b/apps/routerconsole/jsp/jobs.jsp
index d75207c84d..0b51d71656 100644
--- a/apps/routerconsole/jsp/jobs.jsp
+++ b/apps/routerconsole/jsp/jobs.jsp
@@ -9,6 +9,6 @@
 <div class="main" id="main">
  <jsp:useBean class="net.i2p.router.web.JobQueueHelper" id="jobQueueHelper" scope="request" />
  <jsp:setProperty name="jobQueueHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
- <jsp:setProperty name="jobQueueHelper" property="writer" value="<%=out%>" />
+ <jsp:setProperty name="jobQueueHelper" property="writer" value="<%=out%>" /><hr>
  <jsp:getProperty name="jobQueueHelper" property="jobQueueSummary" />
 </div></body></html>
diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp
index c7672d4f3f..87bcaf0a01 100644
--- a/apps/routerconsole/jsp/summary.jsp
+++ b/apps/routerconsole/jsp/summary.jsp
@@ -22,10 +22,10 @@
     } else {
         // since we don't have an iframe this will reload the base page, and
         // the new delay will be passed to the iframe above
-        out.print("<form action=\"" + request.getRequestURI() + "\" method=\"GET\">\n");
+        out.print("<div class=\"refresh\"><form action=\"" + request.getRequestURI() + "\" method=\"GET\">\n");
         out.print("<b>Refresh (s):</b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" />\n");
         out.print("<button type=\"submit\">Enable</button>\n");
-        out.print("</form></div>\n");
+        out.print("</form></div></div>\n");
     }
 %>
 </div>
diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp
index 5d1d9eb2b9..26c6cb3289 100644
--- a/apps/routerconsole/jsp/summaryframe.jsp
+++ b/apps/routerconsole/jsp/summaryframe.jsp
@@ -53,14 +53,14 @@
 <%
     // d and shutdownSoon defined above
     if (!shutdownSoon) {
-        out.print("<hr><form action=\"summaryframe.jsp\" method=\"GET\">\n");
+        out.print("<hr><div class=\"refresh\"><form action=\"summaryframe.jsp\" method=\"GET\">\n");
         if ("0".equals(d)) {
-            out.print("<b>Refresh (s):<b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" align=\"right\" />\n");
-            out.print("<button type=\"submit\">Enable</button>\n");
+            out.print("<b>Refresh (s):<b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" />\n");
+            out.print("<button type=\"submit\">Enable</button></div>\n");
         } else {
             // this will load in the iframe but subsequent pages will not have the iframe
             out.print("<input type=\"hidden\" name=\"refresh\" value=\"0\" />\n");
-            out.print("<button type=\"submit\">Disable " + d + "s Refresh</button>\n");
+            out.print("<button type=\"submit\">Disable " + d + "s Refresh</button></div>\n");
         }
         out.print("</form><hr>\n");
     }
diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css
index 84cefeff5e..55c77d869f 100644
--- a/installer/resources/themes/console/classic/console.css
+++ b/installer/resources/themes/console/classic/console.css
@@ -218,7 +218,14 @@ div.routersummary tr {
 }
      
 div.routersummary form {
-     margin-top: 8px;
+     margin-top: -6px !important;
+     margin-bottom: -4px !important;     
+}
+
+div.refresh {
+     margin-top: 10px !important;
+     margin-bottom: 10px !important;
+     padding: 2px 0 !important;
 }
 
 div.routersummary p {
@@ -268,7 +275,7 @@ div.main {
 }
 
 div.main ul {
-     margin: 5px 0 -10px -10px;
+     margin: -10px 0 -10px -10px;
 }
 
 div.main li {
@@ -293,6 +300,7 @@ div.main textarea {
 
 div.main h2 {
      margin-top: 20px;
+     margin-bottom: -5px;
 }
 
 div.welcome {
@@ -300,8 +308,25 @@ div.welcome {
 }
 
 div.main h2:first-child, div.main h3:first-child {
-     margin-top: 0px;
-     margin-bottom: 10px;
+     margin-top: 0px; 
+     margin-bottom: -5px;
+}
+
+div.wideload h2 {
+     margin-bottom: 0px !important;
+}
+
+div.wideload h3:first-child {
+     margin-top: 0 !important;
+}
+
+div.wideload h3 {
+     margin-top: 15px !important;      
+     margin-bottom: 0px !important;
+}
+
+div.wideload p !important {
+     margin-top: 5px;
 }
 
 div.news {
@@ -401,6 +426,7 @@ div.configure h2:first-child {
 
 .topshimten {
      margin-top: 15px;
+     margin-bottom: 15px;
 } 
 
 div.messages {
@@ -615,6 +641,7 @@ p {
 
 .formaction {
      text-align: right;
+     margin: -10px -5px;
 }
 
 .langbox {
@@ -634,6 +661,7 @@ p {
 .links {
      padding-bottom: -2px;
      text-align: justify;
+     margin-top: 5px !important;
 }
 
 .links li {
@@ -731,7 +759,7 @@ div.graphspanel hr {
      margin: 10px 0;
 }
 
-div.graphspanel form {
+div.graphspanel form:last-child {
      text-align: left;
      margin: 0 20px;
 }
diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css
index ff6e9f3cb2..e415b56d8c 100644
--- a/installer/resources/themes/console/dark/console.css
+++ b/installer/resources/themes/console/dark/console.css
@@ -186,6 +186,12 @@ div.routersummary p {
      padding: 0;
 }     
 
+div.refresh {
+     margin-top: -10px !important;
+     margin-bottom: -4px !important;
+     padding: 2px 0 0px 0 !important;
+}
+
 div.routersummary a:link, div.routersummary a:visited {
      text-shadow: 0px 0px 1px rgba(192, 192, 255, 0.5);
 }
diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css
index bfef5ace25..f5df72dace 100644
--- a/installer/resources/themes/console/light/console.css
+++ b/installer/resources/themes/console/light/console.css
@@ -178,6 +178,12 @@ div.routersummary p {
      padding: 0;
 }     
 
+div.refresh {
+     margin-top: -6px !important;
+     margin-bottom: -8px !important;
+     padding: 2px 0 0px 0 !important;
+}
+
 div.routersummary a:link, div.routersummary a:visited {
      text-shadow: 0px 0px 1px rgba(0, 0, 32, 0.5);
 }
diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
index 2614af25d4..743acf17a6 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
@@ -642,11 +642,11 @@ public class NTCPTransport extends TransportImpl {
         long totalRecv = 0;
 
         StringBuilder buf = new StringBuilder(512);
-        buf.append("<h3 id=\"ntcpcon\">NTCP connections: ").append(peers.size());
+        buf.append("<div class=\"wideload\"><h3 id=\"ntcpcon\">NTCP connections: ").append(peers.size());
         buf.append(". Limit: ").append(getMaxConnections());
         buf.append(". Timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout()));
         buf.append(".</h3>\n" +
-                   "<div class=\"wideload\"><table>\n" +
+                   "<table>\n" +
                    "<tr><th><a href=\"#def.peer\">Peer</a></th>" +
                    "<th>Dir</th>" +
                    "<th align=\"right\"><a href=\"#def.idle\">Idle</a></th>" +
@@ -730,7 +730,7 @@ public class NTCPTransport extends TransportImpl {
                        "</td></tr>\n");
         }
 
-        buf.append("</table></div>\n");
+        buf.append("</table>\n");
         out.write(buf.toString());
         buf.setLength(0);
     }
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
index 1d57814858..2bdf8a466f 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
@@ -1771,7 +1771,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
         buf.append(". Limit: ").append(getMaxConnections());
         buf.append(". Timeout: ").append(DataHelper.formatDuration(_expireTimeout));
         buf.append(".</h3>\n");
-        buf.append("<div class=\"wideload\"><table>\n");
+        buf.append("<table>\n");
         buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">Peer</a>");
         if (sortFlags != FLAG_ALPHA)
             buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
-- 
GitLab