Dont show firewall warning unless its for real

This commit is contained in:
zzz
2009-08-13 18:46:14 +00:00
parent 5c6d757e35
commit 5decf3cd7a
2 changed files with 13 additions and 1 deletions

View File

@ -154,6 +154,18 @@ public class SummaryHelper extends HelperBase {
else
return _context.commSystem().countActivePeers();
}
/**
* Should we warn about a possible firewall problem?
*/
public boolean showFirewallWarning() {
return _context != null &&
_context.netDb().isInitialized() &&
_context.router().getUptime() > 2*60*1000 &&
_context.commSystem().countActivePeers() <= 0 &&
_context.netDb().getKnownRouters() > 5;
}
/**
* How many active identities have we spoken with recently
*

View File

@ -92,7 +92,7 @@
<tr><td align="left"><b>High capacity:</b></td><td align="right"><jsp:getProperty name="helper" property="highCapacityPeers" /></td></tr>
<tr><td align="left"><b>Integrated:</b></td><td align="right"><jsp:getProperty name="helper" property="wellIntegratedPeers" /></td></tr>
<tr><td align="left"><b>Known:</b></td><td align="right"><jsp:getProperty name="helper" property="allPeers" /></td></tr></table><hr><%
if (helper.getActivePeers() <= 0) {
if (helper.showFirewallWarning()) {
%><h4><a href="config.jsp" target="_top" title="Help with firewall configuration.">Check NAT/firewall</a></h4><%
}
// If showing the reseed link is allowed