Minor changes to the I2PSnark UI.

This commit is contained in:
z3d
2009-08-19 18:28:44 +00:00
parent a309a14396
commit d56aae8913
2 changed files with 30 additions and 24 deletions

View File

@@ -84,8 +84,8 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("<meta http-equiv=\"refresh\" content=\"60;" + req.getRequestURI() + peerString + "\">\n"); out.write("<meta http-equiv=\"refresh\" content=\"60;" + req.getRequestURI() + peerString + "\">\n");
out.write(HEADER); out.write(HEADER);
out.write("</head><body>"); out.write("</head><body>");
out.write("<center><div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\" class=\"snarklogo\"></a></table>"); out.write("<center><div class=\"page\">");
out.write("<div class=\"snarknavbar\"><a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n"); out.write("<div class=\"snarknavbar\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"Refresh page\" class=\"snarkRefresh\">I2PSnark</a> <a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n");
Map trackers = _manager.getTrackers(); Map trackers = _manager.getTrackers();
for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) { for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry entry = (Map.Entry)iter.next(); Map.Entry entry = (Map.Entry)iter.next();
@@ -116,13 +116,13 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("(<a href=\"" + req.getRequestURI() + "?p=1" + "\">Show Peers</a>)<br>\n"); out.write("(<a href=\"" + req.getRequestURI() + "?p=1" + "\">Show Peers</a>)<br>\n");
} }
out.write(TABLE_HEADER2); out.write(TABLE_HEADER2);
out.write("<th align=\"left\">"); out.write("<th align=\"center\">");
if (_manager.util().connected()) if (_manager.util().connected())
out.write("<a href=\"" + uri + "?action=StopAll&nonce=" + _nonce + out.write("<a href=\"" + uri + "?action=StopAll&nonce=" + _nonce +
"\" title=\"Stop all torrents and the i2p tunnel\">Stop All</a>"); "\" title=\"Stop all torrents and the I2P tunnel\">Stop All</a>");
else if (snarks.size() > 0) else if (snarks.size() > 0)
out.write("<a href=\"" + uri + "?action=StartAll&nonce=" + _nonce + out.write("<a href=\"" + uri + "?action=StartAll&nonce=" + _nonce +
"\" title=\"Start all torrents and the i2p tunnel\">Start All</a>"); "\" title=\"Start all torrents and the I2P tunnel\">Start All</a>");
else else
out.write("&nbsp;"); out.write("&nbsp;");
out.write("</th></tr></thead>\n"); out.write("</th></tr></thead>\n");
@@ -487,7 +487,7 @@ public class I2PSnarkServlet extends HttpServlet {
String rowClass = (row % 2 == 0 ? "snarkTorrentEven" : "snarkTorrentOdd"); String rowClass = (row % 2 == 0 ? "snarkTorrentEven" : "snarkTorrentOdd");
out.write("<tr class=\"" + rowClass + "\">"); out.write("<tr class=\"" + rowClass + "\">");
out.write("<td align=\"left\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">");
out.write(statusString + "</td>\n\t"); out.write(statusString + "</td>\n\t");
out.write("<td align=\"left\" class=\"snarkTorrentName " + rowClass + "\">"); out.write("<td align=\"left\" class=\"snarkTorrentName " + rowClass + "\">");
@@ -521,7 +521,7 @@ public class I2PSnarkServlet extends HttpServlet {
} }
out.write("</td>\n\t"); out.write("</td>\n\t");
out.write("<td align=\"right\" class=\"snarkTorrentETA " + rowClass + "\">"); out.write("<td align=\"center\" class=\"snarkTorrentETA " + rowClass + "\">");
if(isRunning && remainingSeconds > 0) if(isRunning && remainingSeconds > 0)
out.write(DataHelper.formatDuration(remainingSeconds*1000)); // (eta 6h) out.write(DataHelper.formatDuration(remainingSeconds*1000)); // (eta 6h)
out.write("</td>\n\t"); out.write("</td>\n\t");
@@ -541,7 +541,7 @@ public class I2PSnarkServlet extends HttpServlet {
if(isRunning) if(isRunning)
out.write(formatSize(upBps) + "ps"); out.write(formatSize(upBps) + "ps");
out.write("</td>\n\t"); out.write("</td>\n\t");
out.write("<td align=\"left\" class=\"snarkTorrentAction " + rowClass + "\">"); out.write("<td align=\"center\" class=\"snarkTorrentAction " + rowClass + "\">");
String parameters = "&nonce=" + _nonce + "&torrent=" + Base64.encode(snark.meta.getInfoHash()); String parameters = "&nonce=" + _nonce + "&torrent=" + Base64.encode(snark.meta.getInfoHash());
if (showPeers) if (showPeers)
parameters = parameters + "&p=1"; parameters = parameters + "&p=1";
@@ -566,9 +566,9 @@ public class I2PSnarkServlet extends HttpServlet {
if (!peer.isConnected()) if (!peer.isConnected())
continue; continue;
out.write("<tr class=\"" + rowClass + "\">"); out.write("<tr class=\"" + rowClass + "\">");
out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">");
out.write("</td>\n\t"); out.write("</td>\n\t");
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">");
String ch = peer.toString().substring(0, 4); String ch = peer.toString().substring(0, 4);
String client; String client;
if ("AwMD".equals(ch)) if ("AwMD".equals(ch))
@@ -587,7 +587,7 @@ public class I2PSnarkServlet extends HttpServlet {
client = "Robert"; client = "Robert";
else else
client = "Unknown (" + ch + ')'; client = "Unknown (" + ch + ')';
out.write("<font size=-1>" + client + "</font>&nbsp;&nbsp;<tt>" + peer.toString().substring(5, 9) + "</tt>"); out.write("<font size=-1>" + client + "</font>&nbsp;&nbsp;" + peer.toString().substring(5, 9) + "");
if (showDebug) if (showDebug)
out.write(" inactive " + (peer.getInactiveTime() / 1000) + "s"); out.write(" inactive " + (peer.getInactiveTime() / 1000) + "s");
out.write("</td>\n\t"); out.write("</td>\n\t");
@@ -790,11 +790,11 @@ public class I2PSnarkServlet extends HttpServlet {
private static final String TABLE_HEADER = "<table border=\"0\" class=\"snarkTorrents\" width=\"100%\" cellpadding=\"0 10px\">\n" + private static final String TABLE_HEADER = "<table border=\"0\" class=\"snarkTorrents\" width=\"100%\" cellpadding=\"0 10px\">\n" +
"<thead>\n" + "<thead>\n" +
"<tr><th align=\"left\">Status \n"; "<tr><th align=\"center\">Status \n";
private static final String TABLE_HEADER2 = "</th>\n" + private static final String TABLE_HEADER2 = "</th>\n" +
" <th align=\"left\">Torrent</th>\n" + " <th align=\"left\">Torrent</th>\n" +
" <th align=\"right\">ETA</th>\n" + " <th align=\"center\">ETA</th>\n" +
" <th align=\"right\">Downloaded</th>\n" + " <th align=\"right\">Downloaded</th>\n" +
" <th align=\"right\">Uploaded</th>\n" + " <th align=\"right\">Uploaded</th>\n" +
" <th align=\"right\">Down Rate</th>\n" + " <th align=\"right\">Down Rate</th>\n" +

View File

@@ -47,7 +47,7 @@ body {
color: #f30; color: #f30;
border-bottom: 3px solid #f30; border-bottom: 3px solid #f30;
border-top: 3px solid #f30; border-top: 3px solid #f30;
text-shadow: 0px 0px 1px rgba(255, 163, 0, 0.9); text-shadow: 0px 0px 1px rgba(255, 32, 0, 0.5);
} }
.snarkMessages { .snarkMessages {
@@ -95,7 +95,7 @@ th {
border-top: 1px outset #001; border-top: 1px outset #001;
border-bottom: 1px inset #001; border-bottom: 1px inset #001;
background: #f60 url('/themes/console/images/tabletitleorange.png') repeat-x; background: #f60 url('/themes/console/images/tabletitleorange.png') repeat-x;
text-align: right; /* text-align: right; */
whitespace: nowrap; whitespace: nowrap;
} }
@@ -107,7 +107,7 @@ th {
td { td {
padding: 5px; padding: 5px;
text-align: right; /* text-align: right;*/
} }
.snarkTorrentEven { .snarkTorrentEven {
background-color: #fb1; background-color: #fb1;
@@ -139,8 +139,8 @@ td {
color:#310; color:#310;
min-width: 800px !important; min-width: 800px !important;
/* max-width: 800px !important; */ /* max-width: 800px !important; */
margin: 20px; margin: 10px;
padding: 10px 20px 5px 20px; padding: 10px 10px 5px 10px;
-moz-border-radius: 4px; -moz-border-radius: 4px;
-khtml-border-radius: 4px; -khtml-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
@@ -224,7 +224,7 @@ img:hover{
div.section { div.section {
margin: 0 0 20px 0; margin: 0 0 10px 0;
padding: 10px; padding: 10px;
background: #ffe; background: #ffe;
border: 1px solid #001; border: 1px solid #001;
@@ -241,7 +241,7 @@ div.section {
} }
div.mainsection { div.mainsection {
margin: 0 0 20px 0; margin: 0 0 10px 0;
padding: 10px; padding: 10px;
background: #ffe; background: #ffe;
border: 1px solid #001; border: 1px solid #001;
@@ -258,7 +258,7 @@ div.mainsection {
} }
div.newtorrentsection { div.newtorrentsection {
margin: 0 0 20px 0; margin: 0 0 10px 0;
padding: 10px; padding: 10px;
background: #ffe; background: #ffe;
border: 1px solid #001; border: 1px solid #001;
@@ -275,7 +275,7 @@ div.newtorrentsection {
} }
div.addtorrentsection { div.addtorrentsection {
margin: 0 0 20px 0; margin: 0 0 10px 0;
padding: 10px; padding: 10px;
background: #ffe; background: #ffe;
border: 1px solid #001; border: 1px solid #001;
@@ -292,7 +292,7 @@ div.addtorrentsection {
} }
div.configsection { div.configsection {
margin: 0 0 20px 0; margin: 0 0 10px 0;
padding: 10px; padding: 10px;
background: #ffe; background: #ffe;
border: 1px solid #001; border: 1px solid #001;
@@ -317,7 +317,7 @@ div.configsection a:hover{
} }
.snarknavbar { .snarknavbar {
margin: 5px 0 20px 0 !important; margin: 0 0 10px 0 !important;
padding: 10px; padding: 10px;
border: 1px solid #001; border: 1px solid #001;
-moz-border-radius: 4px; -moz-border-radius: 4px;
@@ -326,4 +326,10 @@ div.configsection a:hover{
background: #eef; background: #eef;
-moz-box-shadow: inset 0px 0px 1px 0px #002; -moz-box-shadow: inset 0px 0px 1px 0px #002;
background: #ddf url('../console/light/images/tabletile.png'); background: #ddf url('../console/light/images/tabletile.png');
text-transform: uppercase !important;
letter-spacing: 0.05em;
font-weight: bold;
font-size: 11pt;
color: #001;
text-shadow: 0px 0px 1px rgba(0, 0, 148, 0.9);
} }