forked from I2P_Developers/i2p.i2p
* i2psnark:
- Only show lower section on first page - Hide peer count if not connected - Dir page CSS tweaks
This commit is contained in:
@ -319,13 +319,15 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
writeConfigForm(out, req);
|
writeConfigForm(out, req);
|
||||||
writeTrackerForm(out, req);
|
writeTrackerForm(out, req);
|
||||||
} else {
|
} else {
|
||||||
writeTorrents(out, req);
|
boolean pageOne = writeTorrents(out, req);
|
||||||
// end of mainsection div
|
// end of mainsection div
|
||||||
out.write("</div><div id=\"lowersection\">\n");
|
if (pageOne) {
|
||||||
writeAddForm(out, req);
|
out.write("</div><div id=\"lowersection\">\n");
|
||||||
writeSeedForm(out, req, sortedTrackers);
|
writeAddForm(out, req);
|
||||||
writeConfigLink(out);
|
writeSeedForm(out, req, sortedTrackers);
|
||||||
// end of lowersection div
|
writeConfigLink(out);
|
||||||
|
// end of lowersection div
|
||||||
|
}
|
||||||
out.write("</div>\n");
|
out.write("</div>\n");
|
||||||
}
|
}
|
||||||
out.write(FOOTER);
|
out.write(FOOTER);
|
||||||
@ -354,7 +356,10 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeTorrents(PrintWriter out, HttpServletRequest req) throws IOException {
|
/**
|
||||||
|
* @return true if on first page
|
||||||
|
*/
|
||||||
|
private boolean writeTorrents(PrintWriter out, HttpServletRequest req) throws IOException {
|
||||||
/** dl, ul, down rate, up rate, peers, size */
|
/** dl, ul, down rate, up rate, peers, size */
|
||||||
final long stats[] = {0,0,0,0,0,0};
|
final long stats[] = {0,0,0,0,0,0};
|
||||||
String peerParam = req.getParameter("p");
|
String peerParam = req.getParameter("p");
|
||||||
@ -585,8 +590,11 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
out.write(": ");
|
out.write(": ");
|
||||||
out.write(ngettext("1 torrent", "{0} torrents", total));
|
out.write(ngettext("1 torrent", "{0} torrents", total));
|
||||||
out.write(", ");
|
out.write(", ");
|
||||||
out.write(DataHelper.formatSize2(stats[5]) + "B, ");
|
out.write(DataHelper.formatSize2(stats[5]) + "B");
|
||||||
out.write(ngettext("1 connected peer", "{0} connected peers", (int) stats[4]));
|
if (_manager.util().connected() && total > 0) {
|
||||||
|
out.write(", ");
|
||||||
|
out.write(ngettext("1 connected peer", "{0} connected peers", (int) stats[4]));
|
||||||
|
}
|
||||||
DHT dht = _manager.util().getDHT();
|
DHT dht = _manager.util().getDHT();
|
||||||
if (dht != null) {
|
if (dht != null) {
|
||||||
int dhts = dht.size();
|
int dhts = dht.size();
|
||||||
@ -598,7 +606,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
out.write(dht.renderStatusHTML());
|
out.write(dht.renderStatusHTML());
|
||||||
}
|
}
|
||||||
out.write("</th>\n");
|
out.write("</th>\n");
|
||||||
if (_manager.util().connected()) {
|
if (_manager.util().connected() && total > 0) {
|
||||||
out.write(" <th align=\"right\">" + formatSize(stats[0]) + "</th>\n" +
|
out.write(" <th align=\"right\">" + formatSize(stats[0]) + "</th>\n" +
|
||||||
" <th align=\"right\">" + formatSize(stats[1]) + "</th>\n" +
|
" <th align=\"right\">" + formatSize(stats[1]) + "</th>\n" +
|
||||||
" <th align=\"right\">" + formatSize(stats[2]) + "ps</th>\n" +
|
" <th align=\"right\">" + formatSize(stats[2]) + "ps</th>\n" +
|
||||||
@ -613,6 +621,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
out.write("</table>");
|
out.write("</table>");
|
||||||
if (isForm)
|
if (isForm)
|
||||||
out.write("</form>\n");
|
out.write("</form>\n");
|
||||||
|
return start == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -292,7 +292,7 @@ td:first-child {
|
|||||||
|
|
||||||
.snarkTorrentEven {
|
.snarkTorrentEven {
|
||||||
font-size: 7.5pt;
|
font-size: 7.5pt;
|
||||||
background: #202;
|
background: #270027;
|
||||||
}
|
}
|
||||||
|
|
||||||
.snarkTorrentNoneLoaded {
|
.snarkTorrentNoneLoaded {
|
||||||
@ -389,12 +389,12 @@ td:first-child {
|
|||||||
|
|
||||||
.snarkTorrentInfo img {
|
.snarkTorrentInfo img {
|
||||||
max-height: 16px !important;
|
max-height: 16px !important;
|
||||||
margin: 1px 0 1px 2px !important;
|
margin: 1px 2px 2px 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.snarkTorrentInfo td {
|
.snarkTorrentInfo td {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
padding: 0 1px !important;
|
padding: 2px 0 1px 1px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.SnarkTorrentInfo {
|
table.SnarkTorrentInfo {
|
||||||
@ -408,6 +408,7 @@ table.SnarkDirInfo {
|
|||||||
|
|
||||||
.snarkDirInfo thead img {
|
.snarkDirInfo thead img {
|
||||||
margin: 0 -1px 0 0 !important;
|
margin: 0 -1px 0 0 !important;
|
||||||
|
padding: 0 3px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.SnarkDirInfo td, .SnarkDirInfo th {
|
.SnarkDirInfo td, .SnarkDirInfo th {
|
||||||
|
@ -401,12 +401,12 @@ td:first-child {
|
|||||||
|
|
||||||
.snarkTorrentInfo img {
|
.snarkTorrentInfo img {
|
||||||
max-height: 16px !important;
|
max-height: 16px !important;
|
||||||
margin: 1px 0 1px 2px !important;
|
margin: 1px 2px 2px 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.snarkTorrentInfo td {
|
.snarkTorrentInfo td {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
padding: 0 1px !important;
|
padding: 2px 0 1px 1px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.SnarkTorrentInfo {
|
table.SnarkTorrentInfo {
|
||||||
@ -421,6 +421,7 @@ table.SnarkDirInfo {
|
|||||||
|
|
||||||
.snarkDirInfo thead img {
|
.snarkDirInfo thead img {
|
||||||
margin: 0 -1px 0 0 !important;
|
margin: 0 -1px 0 0 !important;
|
||||||
|
padding: 0 3px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.SnarkDirInfo td {
|
.SnarkDirInfo td {
|
||||||
|
Reference in New Issue
Block a user