Console: Hide disabled transports on /peers

This commit is contained in:
zzz
2019-02-08 13:58:38 +00:00
parent 5b78b53fe8
commit 51b27bbf0c

View File

@ -16,6 +16,7 @@ import java.util.TreeSet;
import net.i2p.data.DataHelper;
import net.i2p.data.router.RouterAddress;
import net.i2p.router.transport.Transport;
import net.i2p.router.transport.TransportManager;
import net.i2p.router.transport.ntcp.NTCPConnection;
import net.i2p.router.transport.ntcp.NTCPTransport;
import net.i2p.router.transport.udp.PeerState;
@ -184,6 +185,13 @@ public class PeerHelper extends HelperBase {
buf.append("<span class=\"tab2\">");
buf.append(_t(titles[i]));
} else {
if (i == 1) {
if (!_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_NTCP))
continue;
} else if (i == 2) {
if (!_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP))
continue;
}
// we are not there, make a link
if (span)
buf.append("<span class=\"tab\">");