I2PSnark: Reduced label lengths in preparation for icon substitution and tooltip; more colorification; Opera kludges.

This commit is contained in:
z3d
2010-09-17 22:59:22 +00:00
parent dc22949b47
commit 27808012d0
3 changed files with 48 additions and 27 deletions

View File

@ -239,7 +239,7 @@ public class I2PSnarkServlet extends Default {
out.write(TABLE_HEADER); out.write(TABLE_HEADER);
out.write(_("Status")); out.write(_("Status"));
if (_manager.util().connected() && !snarks.isEmpty()) { if (_manager.util().connected() && !snarks.isEmpty()) {
out.write(" (<a href=\""); out.write(" &raquo; <a href=\"");
out.write(req.getRequestURI()); out.write(req.getRequestURI());
if (peerParam != null) { if (peerParam != null) {
out.write("\">"); out.write("\">");
@ -248,20 +248,20 @@ public class I2PSnarkServlet extends Default {
out.write("?p=1\">"); out.write("?p=1\">");
out.write(_("Show Peers")); out.write(_("Show Peers"));
} }
out.write("</a>)<br>\n"); out.write("</a><br>\n");
} }
out.write("</th>\n<th align=\"left\">"); out.write("</th>\n<th align=\"left\">");
out.write(_("Torrent")); out.write(_("Torrent"));
out.write("</th>\n<th align=\"center\">"); out.write("</th>\n<th align=\"center\">");
out.write(_("ETA")); out.write(_("ETA"));
out.write("</th>\n<th align=\"right\">"); out.write("</th>\n<th align=\"right\">");
out.write(_("Downloaded")); out.write(_("RX"));
out.write("</th>\n<th align=\"right\">"); out.write("</th>\n<th align=\"right\">");
out.write(_("Uploaded")); out.write(_("TX"));
out.write("</th>\n<th align=\"right\">"); out.write("</th>\n<th align=\"right\">");
out.write(_("Down Rate")); out.write(_("RX Rate"));
out.write("</th>\n<th align=\"right\">"); out.write("</th>\n<th align=\"right\">");
out.write(_("Up Rate")); out.write(_("TX Rate"));
out.write("</th>\n"); out.write("</th>\n");
out.write("<th align=\"center\">"); out.write("<th align=\"center\">");
@ -598,7 +598,7 @@ public class I2PSnarkServlet extends Default {
return rv; return rv;
} }
private static final int MAX_DISPLAYED_FILENAME_LENGTH = 44; private static final int MAX_DISPLAYED_FILENAME_LENGTH = 38;
private static final int MAX_DISPLAYED_ERROR_LENGTH = 40; private static final int MAX_DISPLAYED_ERROR_LENGTH = 40;
private void displaySnark(PrintWriter out, Snark snark, String uri, int row, long stats[], boolean showPeers, boolean showDebug) throws IOException { private void displaySnark(PrintWriter out, Snark snark, String uri, int row, long stats[], boolean showPeers, boolean showDebug) throws IOException {
String filename = snark.torrent; String filename = snark.torrent;
@ -671,34 +671,34 @@ public class I2PSnarkServlet extends Default {
} }
} else if (remaining <= 0) { } else if (remaining <= 0) {
if (isRunning && curPeers > 0 && !showPeers) if (isRunning && curPeers > 0 && !showPeers)
statusString = _("Seeding") + " (" + statusString = _("Seeding") + " &raquo; " +
"<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" + "<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" +
curPeers + '/' + curPeers + '/' +
ngettext("1 peer", "{0} peers", knownPeers) + "</a>)"; ngettext("1 peer", "{0} peers", knownPeers) + "</a>";
else if (isRunning) else if (isRunning)
statusString = _("Seeding") + " (" + curPeers + "/" + statusString = _("Seeding") + " &raquo; " + curPeers + "/" +
ngettext("1 peer", "{0} peers", knownPeers) + ')'; ngettext("1 peer", "{0} peers", knownPeers);
else else
statusString = _("Complete"); statusString = _("Complete");
} else { } else {
if (isRunning && curPeers > 0 && downBps > 0 && !showPeers) if (isRunning && curPeers > 0 && downBps > 0 && !showPeers)
statusString = _("OK") + " (" + statusString = _("OK") + " &raquo; " +
"<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" + "<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" +
curPeers + "/" + curPeers + "/" +
ngettext("1 peer", "{0} peers", knownPeers) + "</a>)"; ngettext("1 peer", "{0} peers", knownPeers) + "</a>";
else if (isRunning && curPeers > 0 && downBps > 0) else if (isRunning && curPeers > 0 && downBps > 0)
statusString = _("OK") + " (" + curPeers + "/" + statusString = _("OK") + " (" + curPeers + "/" +
ngettext("1 peer", "{0} peers", knownPeers) + ')'; ngettext("1 peer", "{0} peers", knownPeers) + ')';
else if (isRunning && curPeers > 0 && !showPeers) else if (isRunning && curPeers > 0 && !showPeers)
statusString = _("Stalled") + " (" + statusString = _("Stalled") + " &raquo; " +
"<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" + "<a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" +
curPeers + '/' + curPeers + '/' +
ngettext("1 peer", "{0} peers", knownPeers) + "</a>)"; ngettext("1 peer", "{0} peers", knownPeers) + "</a>";
else if (isRunning && curPeers > 0) else if (isRunning && curPeers > 0)
statusString = _("Stalled") + " (" + curPeers + '/' + statusString = _("Stalled") + " &raquo; " + curPeers + '/' +
ngettext("1 peer", "{0} peers", knownPeers) + ')'; ngettext("1 peer", "{0} peers", knownPeers);
else if (isRunning) else if (isRunning)
statusString = _("No Peers") + " (0/" + knownPeers + ')'; statusString = _("No Peers") + " &raquo; 0/" + knownPeers;
else else
statusString = _("Stopped"); statusString = _("Stopped");
} }
@ -745,11 +745,11 @@ public class I2PSnarkServlet extends Default {
if (e < 0) if (e < 0)
continue; continue;
baseURL = baseURL.substring(e + 1); baseURL = baseURL.substring(e + 1);
out.write("&nbsp;&nbsp;&nbsp;[<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash="); out.write("&nbsp;&raquo;&nbsp;<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash=");
out.write(TrackerClient.urlencode(snark.meta.getInfoHash())); out.write(TrackerClient.urlencode(snark.meta.getInfoHash()));
out.write("\" title=\"" + name + ' ' + _("Tracker") + "\">"); out.write("\" title=\"" + name + ' ' + _("Tracker") + "\">");
out.write(_("Details")); out.write(_("Details"));
out.write("</a>]"); out.write("</a>");
break; break;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 193 B

View File

@ -96,8 +96,8 @@ table {
} }
thead, tfoot { thead, tfoot {
background: #333; background: #000;
background: url("../console/images/snark_thead.png") repeat scroll 0 0 #333333; background: url("../console/images/snark_thead.png") repeat-x scroll 0 0 #101;
text-shadow:0 2px 5px #333333; text-shadow:0 2px 5px #333333;
} }
@ -106,6 +106,10 @@ text-shadow: 1px 1px #210;
text-shadow:1px 1px #550000; text-shadow:1px 1px #550000;
} }
thead {
border-bottom: 2px solid #101;
}
th { th {
padding: 4px; padding: 4px;
font-size: 9pt; font-size: 9pt;
@ -116,6 +120,11 @@ th {
whitespace: nowrap; whitespace: nowrap;
} }
th:first-child {
text-align: left;
padding-left: 10px;
}
.SnarkTorrents { .SnarkTorrents {
margin: 0; margin: 0;
border: 1px solid #001; border: 1px solid #001;
@ -123,7 +132,7 @@ th {
} }
td { td {
padding: 2px; padding: 1px;
color: #ddd !important; color: #ddd !important;
font-size: 9.5pt; font-size: 9.5pt;
} }
@ -146,20 +155,31 @@ td:first-child {
} }
.snarkTorrentEven { .snarkTorrentEven {
background: #555; background: #545;
font-size: 8pt; font-size: 8pt;
} }
.snarkTorrentStatus {
line-height: 200%;
}
.snarkTorrentStatus:first-child { .snarkTorrentStatus:first-child {
text-align: left !important; text-align: left !important;
font-style: italic; font-style: italic;
padding-left: 2%; padding-left: 10px;
} }
.snarkTorrentRate, .snarkTorrentDownloaded, .snarkTorrentUploaded {
font-size: 8pt;
font-weight: bold;
}
.snarkTorrentOdd { .snarkTorrentOdd {
background: #444; background: #434;
font-size: 8pt; font-size: 8pt;
border: 1px inset #323;
border-left: 0;
border-right: 0;
} }
.snarkFileName { .snarkFileName {
@ -314,7 +334,8 @@ input[type=text]:active, input[type=text]:hover, input.r:hover {
} }
select { select {
background: url('../console/images/graytile.png'); background: #333;
background: url('../console/images/graytile.png') !important;
color: #f60; color: #f60;
font: 9pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; font: 9pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif;
font-weight: bold; font-weight: bold;