forked from I2P_Developers/i2p.i2p
i2psnark: Hide peers button if no peers on that page (ticket #2152)
This commit is contained in:
@ -495,21 +495,31 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
out.write("</a>");
|
||||
out.write("</th>\n<th class=\"snarkTorrentStatus\">");
|
||||
if (_manager.util().connected() && !snarks.isEmpty()) {
|
||||
out.write(" <a href=\"" + _contextPath + '/');
|
||||
if (peerParam != null) {
|
||||
// disable peer view
|
||||
out.write(getQueryString(req, "", null, null));
|
||||
out.write("\">");
|
||||
tx = _t("Hide Peers");
|
||||
out.write(toThemeImg("hidepeers", tx, tx));
|
||||
} else {
|
||||
// enable peer view
|
||||
out.write(getQueryString(req, "1", null, null));
|
||||
out.write("\">");
|
||||
tx = _t("Show Peers");
|
||||
out.write(toThemeImg("showpeers", tx, tx));
|
||||
boolean hasPeers = false;
|
||||
int end = Math.min(start + pageSize, snarks.size());
|
||||
for (int i = start; i < end; i++) {
|
||||
if (snarks.get(i).getPeerCount() > 0) {
|
||||
hasPeers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasPeers) {
|
||||
out.write(" <a href=\"" + _contextPath + '/');
|
||||
if (peerParam != null) {
|
||||
// disable peer view
|
||||
out.write(getQueryString(req, "", null, null));
|
||||
out.write("\">");
|
||||
tx = _t("Hide Peers");
|
||||
out.write(toThemeImg("hidepeers", tx, tx));
|
||||
} else {
|
||||
// enable peer view
|
||||
out.write(getQueryString(req, "1", null, null));
|
||||
out.write("\">");
|
||||
tx = _t("Show Peers");
|
||||
out.write(toThemeImg("showpeers", tx, tx));
|
||||
}
|
||||
out.write("</a>\n");
|
||||
}
|
||||
out.write("</a>\n");
|
||||
}
|
||||
out.write("</th>\n<th colspan=\"2\" align=\"left\">");
|
||||
// cycle through sort by name or type
|
||||
|
@ -1,6 +1,12 @@
|
||||
2018-05-26 zzz
|
||||
* /confignet: Reorganize (ticket #2217)
|
||||
* /configsidebar: Tag sections for translation; sort unselected sections by translated name
|
||||
* i2psnark:
|
||||
- Hide "0 Bps" if no peers (ticket #2152)
|
||||
- Hide peers button if no peers (ticket #2152)
|
||||
- Hide column 1 icon for peers (ticket #1996)
|
||||
* i2ptunnel: Retry accept after server socket closed (ticket #2003)
|
||||
* Jetty: Skip files with [] in default servlet listing
|
||||
* Router: Fix wrapper.config path in OOM message when installed as
|
||||
Debian package, but not running as a service (ticket #2223)
|
||||
* Summary Bar: Change header from "I2P Updates" to "Update Status" (ticket #2137)
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 13;
|
||||
public final static long BUILD = 14;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
Reference in New Issue
Block a user