forked from I2P_Developers/i2p.i2p
- Simplify bw form
- Add config link to UPnP status
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package net.i2p.router.web;
|
package net.i2p.router.web;
|
||||||
|
|
||||||
|
import net.i2p.data.DataHelper;
|
||||||
import net.i2p.data.RouterAddress;
|
import net.i2p.data.RouterAddress;
|
||||||
import net.i2p.router.CommSystemFacade;
|
import net.i2p.router.CommSystemFacade;
|
||||||
import net.i2p.router.LoadTestManager;
|
import net.i2p.router.LoadTestManager;
|
||||||
@ -158,6 +159,18 @@ public class ConfigNetHelper extends HelperBase {
|
|||||||
public String getOutboundRate() {
|
public String getOutboundRate() {
|
||||||
return "" + _context.bandwidthLimiter().getOutboundKBytesPerSecond();
|
return "" + _context.bandwidthLimiter().getOutboundKBytesPerSecond();
|
||||||
}
|
}
|
||||||
|
public String getInboundRateBits() {
|
||||||
|
return kbytesToBits(_context.bandwidthLimiter().getInboundKBytesPerSecond());
|
||||||
|
}
|
||||||
|
public String getOutboundRateBits() {
|
||||||
|
return kbytesToBits(_context.bandwidthLimiter().getOutboundKBytesPerSecond());
|
||||||
|
}
|
||||||
|
public String getShareRateBits() {
|
||||||
|
return kbytesToBits(getShareBandwidth());
|
||||||
|
}
|
||||||
|
private String kbytesToBits(int kbytes) {
|
||||||
|
return DataHelper.formatSize(kbytes * 8 * 1024) + " bits per second";
|
||||||
|
}
|
||||||
public String getInboundBurstRate() {
|
public String getInboundBurstRate() {
|
||||||
return "" + _context.bandwidthLimiter().getInboundBurstKBytesPerSecond();
|
return "" + _context.bandwidthLimiter().getInboundBurstKBytesPerSecond();
|
||||||
}
|
}
|
||||||
@ -231,7 +244,7 @@ public class ConfigNetHelper extends HelperBase {
|
|||||||
buf.append("selected=\"true\" ");
|
buf.append("selected=\"true\" ");
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
buf.append(">Up to ").append(val).append("%</option>\n");
|
buf.append(">").append(val).append("%</option>\n");
|
||||||
}
|
}
|
||||||
buf.append("</select>\n");
|
buf.append("</select>\n");
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
|
@ -29,20 +29,28 @@
|
|||||||
<input type="hidden" name="action" value="blah" />
|
<input type="hidden" name="action" value="blah" />
|
||||||
|
|
||||||
<b>Bandwidth limiter</b><br />
|
<b>Bandwidth limiter</b><br />
|
||||||
Inbound rate:
|
<p>
|
||||||
<input name="inboundrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="inboundRate" />" /> KBps
|
<table>
|
||||||
|
<tr><td><input style="text-align: right; width: 5em;" name="inboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="inboundRate" />" /> KBps
|
||||||
|
In <td>(<jsp:getProperty name="nethelper" property="inboundRateBits" />)<br />
|
||||||
|
<!-- let's keep this simple...
|
||||||
bursting up to
|
bursting up to
|
||||||
<input name="inboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="inboundBurstRate" />" /> KBps for
|
<input name="inboundburstrate" type="text" size="5" value="<jsp:getProperty name="nethelper" property="inboundBurstRate" />" /> KBps for
|
||||||
<jsp:getProperty name="nethelper" property="inboundBurstFactorBox" /><br />
|
<jsp:getProperty name="nethelper" property="inboundBurstFactorBox" /><br />
|
||||||
Outbound rate:
|
-->
|
||||||
<input name="outboundrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundRate" />" /> KBps
|
<tr><td><input style="text-align: right; width: 5em;" name="outboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="outboundRate" />" /> KBps
|
||||||
|
Out <td>(<jsp:getProperty name="nethelper" property="outboundRateBits" />)<br />
|
||||||
|
<!-- let's keep this simple...
|
||||||
bursting up to
|
bursting up to
|
||||||
<input name="outboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundBurstRate" />" /> KBps for
|
<input name="outboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundBurstRate" />" /> KBps for
|
||||||
<jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br />
|
<jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br />
|
||||||
<i>KBps = kilobytes per second = 1024 bytes per second = 8192 bits per second.<br />
|
<i>KBps = kilobytes per second = 1024 bytes per second = 8192 bits per second.<br />
|
||||||
A negative rate sets the default.</i><br />
|
A negative rate sets the default.</i><br />
|
||||||
Bandwidth share percentage:
|
-->
|
||||||
<jsp:getProperty name="nethelper" property="sharePercentageBox" /><br />
|
<tr><td><jsp:getProperty name="nethelper" property="sharePercentageBox" />
|
||||||
|
Share <td>(<jsp:getProperty name="nethelper" property="shareRateBits" />)<br />
|
||||||
|
</table>
|
||||||
|
</p><p>
|
||||||
<% int share = nethelper.getShareBandwidth();
|
<% int share = nethelper.getShareBandwidth();
|
||||||
if (share < 12) {
|
if (share < 12) {
|
||||||
out.print("<b>NOTE</b>: You have configured I2P to share only " + share + "KBps. ");
|
out.print("<b>NOTE</b>: You have configured I2P to share only " + share + "KBps. ");
|
||||||
@ -54,7 +62,7 @@
|
|||||||
out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<br />");
|
out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<br />");
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<p>
|
</p><p>
|
||||||
<input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /><br />
|
<input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /><br />
|
||||||
<hr />
|
<hr />
|
||||||
<!--
|
<!--
|
||||||
@ -70,7 +78,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>UPnP Configuration:</b><br />
|
<b>UPnP Configuration:</b><br />
|
||||||
<input type="checkbox" name="upnp" value="true" <jsp:getProperty name="nethelper" property="upnpChecked" /> />
|
<input type="checkbox" name="upnp" value="true" <jsp:getProperty name="nethelper" property="upnpChecked" /> />
|
||||||
Enable UPnP to open firewall ports
|
Enable UPnP to open firewall ports <a href="peers.jsp#upnp">UPnP status</a>
|
||||||
</p><p>
|
</p><p>
|
||||||
<b>IP Configuration:</b><br />
|
<b>IP Configuration:</b><br />
|
||||||
Externally reachable hostname or IP address:<br />
|
Externally reachable hostname or IP address:<br />
|
||||||
@ -104,7 +112,7 @@
|
|||||||
</p><p>
|
</p><p>
|
||||||
<b>UDP Configuration:</b><br />
|
<b>UDP Configuration:</b><br />
|
||||||
Internal UDP port:
|
Internal UDP port:
|
||||||
<input name ="udpPort" type="text" size="6" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br />
|
<input name ="udpPort" type="text" size="5" maxlength="5" vvalue="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br />
|
||||||
<input type="checkbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> />
|
<input type="checkbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> />
|
||||||
Require SSU introductions
|
Require SSU introductions
|
||||||
<i>(Enable if you cannot open your firewall)</i>
|
<i>(Enable if you cannot open your firewall)</i>
|
||||||
@ -139,7 +147,7 @@
|
|||||||
<i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br />
|
<i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br />
|
||||||
<input type="radio" name="ntcpAutoPort" value="1" <%=nethelper.getTcpAutoPortChecked(1) %> />
|
<input type="radio" name="ntcpAutoPort" value="1" <%=nethelper.getTcpAutoPortChecked(1) %> />
|
||||||
Specify Port:
|
Specify Port:
|
||||||
<input name ="ntcpport" type="text" size="6" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br />
|
<input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br />
|
||||||
</p><p>Hostnames entered here will be published in the network database.
|
</p><p>Hostnames entered here will be published in the network database.
|
||||||
They are <b>not private</b>.
|
They are <b>not private</b>.
|
||||||
Also, <b>do not enter a private IP address</b> like 127.0.0.1 or 192.168.1.1.
|
Also, <b>do not enter a private IP address</b> like 127.0.0.1 or 192.168.1.1.
|
||||||
|
@ -403,7 +403,7 @@ public class UPnP extends ControlPoint implements DeviceChangeListener {
|
|||||||
|
|
||||||
public String renderStatusHTML() {
|
public String renderStatusHTML() {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<b>UPnP Status:</b><br />");
|
sb.append("<a name=\"upnp\"><b>UPnP Status:</b><br />");
|
||||||
|
|
||||||
if(isDisabled) {
|
if(isDisabled) {
|
||||||
sb.append("The plugin has been disabled; Do you have more than one UPnP Internet Gateway Device on your LAN ?");
|
sb.append("The plugin has been disabled; Do you have more than one UPnP Internet Gateway Device on your LAN ?");
|
||||||
|
@ -139,7 +139,7 @@ public class UPnPManager {
|
|||||||
|
|
||||||
public String renderStatusHTML() {
|
public String renderStatusHTML() {
|
||||||
if (!_isRunning)
|
if (!_isRunning)
|
||||||
return "<b>UPnP is not enabled</b>\n";
|
return "<a name=\"upnp\"><<b>UPnP is not enabled</b>\n";
|
||||||
return _upnp.renderStatusHTML();
|
return _upnp.renderStatusHTML();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user