forked from I2P_Developers/i2p.i2p
Console: Add indication of current ff status on /configadvanced,
change immediately when config changes, force republish Router: RI rebuild locking
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
|
||||
|
||||
/**
|
||||
* Handler to deal with form submissions from the advanced config form and act
|
||||
@@ -83,6 +84,14 @@ public class ConfigAdvancedHandler extends FormHandler {
|
||||
/** @since 0.9.20 */
|
||||
private void saveFF() {
|
||||
boolean saved = _context.router().saveConfig(ConfigAdvancedHelper.PROP_FLOODFILL_PARTICIPANT, _ff);
|
||||
if (_ff.equals("false") || _ff.equals("true")) {
|
||||
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
|
||||
boolean wasFF = fndf.floodfillEnabled();
|
||||
boolean isFF = _ff.equals("true");
|
||||
fndf.setFloodfillEnabled(isFF);
|
||||
if (wasFF != isFF)
|
||||
_context.router().rebuildRouterInfo();
|
||||
}
|
||||
if (saved)
|
||||
addFormNotice(_("Configuration saved successfully"));
|
||||
else
|
||||
|
@@ -35,4 +35,9 @@ public class ConfigAdvancedHelper extends HelperBase {
|
||||
return CHECKED;
|
||||
return "";
|
||||
}
|
||||
|
||||
/** @since 0.9.21 */
|
||||
public boolean isFloodfill() {
|
||||
return _context.netDb().floodfillEnabled();
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,16 @@
|
||||
<div class="configure">
|
||||
<div class="wideload">
|
||||
<h3><%=intl._("Floodfill Configuration")%></h3>
|
||||
<p><%=intl._("Floodill participation helps the network, but may use more of your computer's resources.")%></p>
|
||||
<p><%=intl._("Floodill participation helps the network, but may use more of your computer's resources.")%>
|
||||
</p><p>
|
||||
<%
|
||||
if (advancedhelper.isFloodfill()) {
|
||||
%><%=intl._("This router is currently a floodfill participant.")%><%
|
||||
} else {
|
||||
%><%=intl._("This router is not currently a floodfill participant.")%><%
|
||||
}
|
||||
%>
|
||||
</p>
|
||||
<form action="" method="POST">
|
||||
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
|
||||
<input type="hidden" name="action" value="ff" >
|
||||
|
Reference in New Issue
Block a user