merge of '1a3fcced1ae28b24a35236271c526379db98613f'

and 'a95bd8209bbd14b8c0a590ba071ecf5a0191644d'
This commit is contained in:
z3d
2009-08-20 10:25:42 +00:00
2 changed files with 231 additions and 266 deletions

View File

@ -85,7 +85,7 @@ 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\">"); out.write("<center>");
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"); 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(); ) {
@ -96,10 +96,10 @@ public class I2PSnarkServlet extends HttpServlet {
if (e < 0) if (e < 0)
continue; continue;
baseURL = baseURL.substring(e + 1); baseURL = baseURL.substring(e + 1);
out.write("<a href=\"" + baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + name + "</a>"); out.write(" <a href=\"" + baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + name + "</a>");
} }
out.write("</div>\n"); out.write("</div>\n");
out.write("<div class=\"mainsection\"><div class=\"snarkMessages\"><table><tr><td align=\"left\"><pre>"); out.write("<div class=\"page\"><div class=\"mainsection\"><div class=\"snarkMessages\"><table><tr><td align=\"left\"><pre>");
List msgs = _manager.getMessages(); List msgs = _manager.getMessages();
for (int i = msgs.size()-1; i >= 0; i--) { for (int i = msgs.size()-1; i >= 0; i--) {
String msg = (String)msgs.get(i); String msg = (String)msgs.get(i);
@ -498,7 +498,7 @@ public class I2PSnarkServlet extends HttpServlet {
if (remaining == 0) if (remaining == 0)
out.write("<a href=\"" + _manager.linkPrefix() + snark.meta.getName() out.write("<a href=\"" + _manager.linkPrefix() + snark.meta.getName()
+ "\" title=\"Click to access completed downloaded..\">"); + "\" title=\"View file\">");
out.write(filename); out.write(filename);
if (remaining == 0) if (remaining == 0)
out.write("</a>"); out.write("</a>");
@ -573,7 +573,7 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("<tr class=\"" + rowClass + "\">"); out.write("<tr class=\"" + rowClass + "\">");
out.write("<td align=\"center\" 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=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td align=\"left\" 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))
@ -592,7 +592,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;" + peer.toString().substring(5, 9) + ""); out.write("" + client + "&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");
@ -601,12 +601,12 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
float pct = (float) (100.0 * (float) peer.completed() / snark.meta.getPieces()); float pct = (float) (100.0 * (float) peer.completed() / snark.meta.getPieces());
if (pct == 100.0) if (pct == 100.0)
out.write("<font size=-1>Seed</font>"); out.write("Seed");
else { else {
String ps = String.valueOf(pct); String ps = String.valueOf(pct);
if (ps.length() > 5) if (ps.length() > 5)
ps = ps.substring(0, 5); ps = ps.substring(0, 5);
out.write("<font size=-1>" + ps + "%</font>"); out.write("" + ps + "%");
} }
out.write("</td>\n\t"); out.write("</td>\n\t");
out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">");
@ -615,14 +615,14 @@ public class I2PSnarkServlet extends HttpServlet {
if (remaining > 0) { if (remaining > 0) {
if (peer.isInteresting() && !peer.isChoked()) { if (peer.isInteresting() && !peer.isChoked()) {
out.write("<font color=#008000>"); out.write("<font color=#008000>");
out.write("<font size=-1>" + formatSize(peer.getDownloadRate()) + "ps</font></font>"); out.write("" + formatSize(peer.getDownloadRate()) + "ps</font>");
} else { } else {
out.write("<font color=#a00000><font size=-1><a title=\""); out.write("<font color=#a00000><a title=\"");
if (!peer.isInteresting()) if (!peer.isInteresting())
out.write("Uninteresting\">"); out.write("Uninteresting\">");
else else
out.write("Choked\">"); out.write("Choked\">");
out.write(formatSize(peer.getDownloadRate()) + "ps</a></font></font>"); out.write(formatSize(peer.getDownloadRate()) + "ps</a></font>");
} }
} }
out.write("</td>\n\t"); out.write("</td>\n\t");
@ -630,14 +630,14 @@ public class I2PSnarkServlet extends HttpServlet {
if (pct != 100.0) { if (pct != 100.0) {
if (peer.isInterested() && !peer.isChoking()) { if (peer.isInterested() && !peer.isChoking()) {
out.write("<font color=#008000>"); out.write("<font color=#008000>");
out.write("<font size=-1>" + formatSize(peer.getUploadRate()) + "ps</font></font>"); out.write("" + formatSize(peer.getUploadRate()) + "ps</font>");
} else { } else {
out.write("<font color=#a00000><font size=-1><a title=\""); out.write("<font color=#a00000><a title=\"");
if (!peer.isInterested()) if (!peer.isInterested())
out.write("Uninterested\">"); out.write("Uninterested\">");
else else
out.write("Choking\">"); out.write("Choking\">");
out.write(formatSize(peer.getUploadRate()) + "ps</a></font></font>"); out.write(formatSize(peer.getUploadRate()) + "ps</a></font>");
} }
} }
out.write("</td>\n\t"); out.write("</td>\n\t");

View File

@ -1,335 +1,300 @@
/* Not yet complete. Subject to flux and change. dr|z3d - 07.25.09 */ /* Not yet complete. Subject to flux and change. dr|z3d - 07.25.09 */
body { body {
background-color: #eef; background: #eef;
color:#001; color: #001;
font-family:"Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif; font: 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif;
font-size: 8pt;
} }
.snarkTitle { .snarkTitle {
font-size: 12pt; font-size: 12pt;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
} }
.snarkRefresh:link, .snarkRefresh:visited { .snarkRefresh:link,.snarkRefresh:visited {
text-decoration: none !important; text-decoration: none !important;
text-transform: uppercase !important; text-transform: uppercase !important;
padding: 0 16px; padding: 0 16px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
font-weight: bold; font-weight: bold;
font-size: 11pt; font-size: 11pt;
color: #005; color: #005;
text-shadow: 0px 0px 1px rgba(0, 0, 148, 0.9); text-shadow: 0px 0px 1px rgba(0,0,148,0.9);
} }
.snarkRefresh:hover{ .snarkRefresh:hover {
text-decoration: none !important; text-decoration: none !important;
text-transform: uppercase !important; text-transform: uppercase !important;
padding: 0 16px; padding: 0 16px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
font-weight: bold; font-weight: bold;
font-size: 11pt; font-size: 11pt;
color: #f60; color: #f60;
border-bottom: 3px solid #f60; border-bottom: 3px solid #f60;
border-top: 3px solid #f60; border-top: 3px solid #f60;
text-shadow: 0px 0px 1px rgba(255, 128, 0, 0.9); text-shadow: 0px 0px 1px rgba(255,128,0,0.9);
} }
.snarkRefresh:active{ .snarkRefresh:active {
text-decoration: none !important; text-decoration: none !important;
text-transform: uppercase !important; text-transform: uppercase !important;
padding: 0 16px; padding: 0 16px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
font-weight: bold; font-weight: bold;
font-size: 11pt; font-size: 11pt;
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, 32, 0, 0.5); text-shadow: 0px 0px 1px rgba(255,32,0,0.5);
} }
.snarkMessages { .snarkMessages {
background-color: #f83; font: bold 9pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important;
font-family: "Lucida Console", "DejaVu Sans Mono", Courier, mono !important; text-align: left;
font-size: 9pt; margin: 0 0px 10px 0px;
font-weight: bold; padding: 0;
text-align: left; border-spacing: 0px;
margin: 0 0px 10px 0px; -moz-border-radius: 4px 0 0 0;
padding: 0; -khtml-border-radius: 4px;
border-spacing: 0px; border-radius: 4px;
-moz-border-radius: 4px 0 0 0; border: 2px solid #930;
-khtml-border-radius: 4px; overflow: auto;
border-radius: 4px; color: #531;
border: 2px solid #930; height: 64px;
text-align: left; width: auto;
overflow: auto; background: #f83 url('../console/images/orangetile.png');
background: #f40 url('../console/images/orangetile.png');
color: #531;
height: 64px;
width: auto;
} }
pre { pre {
font-family: "Lucida Console", "DejaVu Sans Mono", Courier, mono !important; width: 100%;
width: 100%; font: 8pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important;
font-size: 8pt; padding: 0;
padding: 0; text-align: left !important;
text-align: left !important; height: 8px;
height: 8px;
} }
table { table {
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
border: 0px; border: 0px;
padding: 0px; padding: 0px;
border-width: 0px; border-spacing: 0px;
border-spacing: 0px; border-collapse: collapse;
border-collapse: collapse;
} }
th { th {
padding: 5px; padding: 4px;
font-size: 8pt; font-size: 8pt;
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; */ whitespace: nowrap;
whitespace: nowrap;
} }
.SnarkTorrents { .SnarkTorrents {
margin: 0; margin: 0;
border: 1px solid #001; border: 1px solid #001;
background-color: #f9f; background: #f9f;
} }
td { td {
padding: 5px; padding: 4px;
/* text-align: right;*/
} }
.snarkTorrentEven { .snarkTorrentEven {
background-color: #fb1; background: #fb1;
font-size: 7pt; font-size: 7pt;
} }
.snarkTorrentOdd { .snarkTorrentOdd {
background-color: #fa1; background: #fa1;
font-size: 7pt; font-size: 7pt;
} }
.snarkNewTorrent { .snarkNewTorrent {
font-size: 9pt; font-size: 9pt;
} }
.snarkAddInfo { .snarkAddInfo {
font-size: 9pt; font-size: 9pt;
line-height: 130% !important; line-height: 130% !important;
} }
.snarkConfigTitle { .snarkConfigTitle {
font-size: 11pt; font-size: 11pt;
font-weight: bold; font-weight: bold;
text-decoration: underline; text-decoration: underline;
text-transform: uppercase;
text-shadow: 0px 0px 2px rgba(172,172,192,0.9);
} }
.snarkConfig { .snarkConfig {
font-size: 10pt; font-size: 10pt;
width: 100%;
} }
.page { .page {
background-color: #fff; background: #fff;
color:#310; color: #310;
min-width: 800px !important; min-width: 800px !important;
/* max-width: 800px !important; */ margin: 5px 0 0 0;
margin: 5px 0px; padding: 10px 10px 0px 10px;
padding: 10px 10px 0px 10px; -moz-border-radius: 4px;
-moz-border-radius: 4px; -khtml-border-radius: 4px;
-khtml-border-radius: 4px; border-radius: 4px;
border-radius: 4px; border: 1px solid #001;
border: 1px solid #001; font-size: 9pt !important;
font-size: 9pt !important; line-height: 160% !important;
line-height: 160% !important; -moz-box-shadow: inset 0px 0px 1px 0px #002;
-moz-box-shadow: inset 0px 0px 1px 0px #002; text-align: center;
text-align: center; opacity: 1.0;
background: #ddf url('../console/light/images/lightbluetile.png');
opacity: 1.0;
} }
form { form {
line-height: 250% line-height: 250%;
} }
p { p {
line-height: 150% line-height: 150%;
}
a:link {
padding 5px;
} }
hr { hr {
color: #003; color: #003;
background: #003; background: #003;
height: 1px; height: 1px;
border: 0px solid #003; border: 0px solid #003;
width: 100%; width: 100%;
margin: 10px 0 7px 0; margin: 10px 0 7px 0;
text-align: center; text-align: center;
} }
a:link{ a:link {
color: #930; color: #930;
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
word-wrap: break-word; word-wrap: break-word;
} }
a:visited{ a:visited {
color: #606; color: #606;
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
} }
a:hover{ a:hover {
color: #900; color: #900;
font-weight: bold; font-weight: bold;
} }
input { input {
/* font-family: "Lucida Console", "DejaVu Sans Mono", Courier, mono !important;*/ font-size: 9pt;
font-size: 9pt; font-weight: bold;
font-weight: bold; text-align: left;
text-align: left; padding: 2px;
padding: 2px; }
}
select { select {
font-family:"Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif; background: #ffe;
background-color: #ffe; color: #310;
color: #310; font: 9pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif;
font-size: 9pt;
} }
img { img {
border: none; border: none;
margin: 5px 5px 0px 5px; margin: 5px 5px 0px 5px;
opacity: 1.0; opacity: 1.0;
line-height: 100% line-height: 100%;
} }
img:hover{ img: hover {
border: none; border: none;
margin: 5px 5px 0px 5px; margin: 5px 5px 0px 5px;
opacity: 0.5; opacity: 0.5;
line-height: 100% line-height: 100%;
} }
div.section,div.mainsection {
div.section { margin: 0 0 10px 0;
margin: 0 0 10px 0; padding: 10px;
padding: 10px; border: 1px solid #001;
background: #ffe; color: #001;
border: 1px solid #001; -moz-border-radius: 4px;
text-align: center; -khtml-border-radius: 4px;
color: #001; border-radius: 4px;
-moz-border-radius: 4px; -moz-box-shadow: inset 0px 0px 1px 0px #002;
-khtml-border-radius: 4px; word-wrap: break-word;
border-radius: 4px; text-align: center;
-moz-box-shadow: inset 0px 0px 1px 0px #002; background: #ffe url('../console/light/images/tabletile.png');
word-wrap: break-word; opacity: 1.0;
text-align: center;
background: #ffe url('../console/light/images/tabletile.png');
opacity: 1.0;
}
div.mainsection {
margin: 0 0 10px 0;
padding: 10px;
background: #ffe;
border: 1px solid #001;
text-align: center;
color: #001;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: inset 0px 0px 1px 0px #002;
word-wrap: break-word;
text-align: center;
background: #ffe url('../console/light/images/tabletile.png');
opacity: 1.0;
} }
div.newtorrentsection { div.newtorrentsection {
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding: 10px; padding: 0 10px 10px 10px;
background: #ffe; border: 1px solid #001;
border: 1px solid #001; text-align: center;
text-align: center; color: #001;
color: #001; -moz-border-radius: 4px;
-moz-border-radius: 4px; -khtml-border-radius: 4px;
-khtml-border-radius: 4px; border-radius: 4px;
border-radius: 4px; -moz-box-shadow: inset 0px 0px 1px 0px #002;
-moz-box-shadow: inset 0px 0px 1px 0px #002; word-wrap: break-word;
word-wrap: break-word; background: #bb4 url('../console/images/yellowtile.png');
text-align: center; opacity: 1.0;
background: #ffe url('../console/images/yellowtile.png');
opacity: 1.0;
} }
div.addtorrentsection { div.addtorrentsection {
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding: 10px; padding: 0 10px 10px 10px;
background: #ffe; border: 1px solid #001;
border: 1px solid #001; text-align: center;
text-align: center; color: #001;
color: #001; -moz-border-radius: 4px;
-moz-border-radius: 4px; -khtml-border-radius: 4px;
-khtml-border-radius: 4px; border-radius: 4px;
border-radius: 4px; -moz-box-shadow: inset 0px 0px 1px 0px #002;
-moz-box-shadow: inset 0px 0px 1px 0px #002; word-wrap: break-word;
word-wrap: break-word; background: #7f7 url('../console/images/greentile.png');
text-align: center; opacity: 1.0;
background: #ffe url('../console/images/greentile.png');
opacity: 1.0;
} }
div.configsection { div.configsection {
margin: 0; margin: 0;
padding: 10px; padding: 0 10px 10px 10px;
background: #ffe; border: 1px solid #001;
border: 1px solid #001; color: #ffb;
color: #ffb; -moz-border-radius: 4px;
-moz-border-radius: 4px; -khtml-border-radius: 4px;
-khtml-border-radius: 4px; border-radius: 4px;
border-radius: 4px; -moz-box-shadow: inset 0px 0px 0px 1px #900;
-moz-box-shadow: inset 0px 0px 0px 1px #900; word-wrap: break-word;
word-wrap: break-word; text-align: center;
text-align: center; background: #700 url('../console/light/images/darkbluetile.png');
background: #ffe url('../console/light/images/darkbluetile.png'); font-weight: bold;/* red tile needs bold text! */
font-weight: bold; /* red tile needs bold text! */
} }
div.configsection a{ div.configsection a {
color: #f90; color: #f90;
} }
div.configsection a:hover{ div.configsection a: hover {
color: #f60; color: #f60;
text-decoration: underline; text-decoration: underline;
} }
.snarknavbar { .snarknavbar {
margin: 0 0 10px 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;
-khtml-border-radius: 4px; -khtml-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
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;
text-transform: uppercase !important; letter-spacing: 0.05em;
letter-spacing: 0.05em; font-weight: bold;
font-weight: bold; font-size: 11pt;
font-size: 11pt; color: #001;
color: #001; text-shadow: 0px 0px 1px rgba(0,0,148,0.9);
text-shadow: 0px 0px 1px rgba(0, 0, 148, 0.9); }
}