forked from I2P_Developers/i2p.i2p
/configreseed: Add 'Reset URL list' button for revert to default hosts (ticket #1554, thanks dzirtt@gmail.com)
This commit is contained in:
@ -96,10 +96,19 @@ public class ConfigReseedHandler extends FormHandler {
|
|||||||
}
|
}
|
||||||
} else if (_action.equals(_("Save changes"))) {
|
} else if (_action.equals(_("Save changes"))) {
|
||||||
saveChanges();
|
saveChanges();
|
||||||
|
} else if (_action.equals(_("Reset URL list"))) {
|
||||||
|
resetUrlList();
|
||||||
}
|
}
|
||||||
//addFormError(_("Unsupported") + ' ' + _action + '.');
|
//addFormError(_("Unsupported") + ' ' + _action + '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetUrlList() {
|
||||||
|
if (_context.router().saveConfig(Reseeder.PROP_RESEED_URL, null))
|
||||||
|
addFormNotice(_("URL list reset successfully"));
|
||||||
|
else
|
||||||
|
addFormError(_("URL list reset failed"));
|
||||||
|
}
|
||||||
|
|
||||||
/** @since 0.8.9 */
|
/** @since 0.8.9 */
|
||||||
private void saveString(String config, String param) {
|
private void saveString(String config, String param) {
|
||||||
String val = getJettyString(param);
|
String val = getJettyString(param);
|
||||||
|
@ -77,7 +77,9 @@
|
|||||||
<input type="radio" class="optbox" name="mode" value="2" <%=reseedHelper.modeChecked(2) %> >
|
<input type="radio" class="optbox" name="mode" value="2" <%=reseedHelper.modeChecked(2) %> >
|
||||||
<b><%=intl._("Use non-SSL only")%></b></td></tr>
|
<b><%=intl._("Use non-SSL only")%></b></td></tr>
|
||||||
<tr><td class="mediumtags" align="right"><b><%=intl._("Reseed URLs")%>:</b></td>
|
<tr><td class="mediumtags" align="right"><b><%=intl._("Reseed URLs")%>:</b></td>
|
||||||
<td><textarea wrap="off" name="reseedURL" cols="60" rows="7" spellcheck="false"><jsp:getProperty name="reseedHelper" property="reseedURL" /></textarea></td></tr>
|
<td><textarea wrap="off" name="reseedURL" cols="60" rows="7" spellcheck="false"><jsp:getProperty name="reseedHelper" property="reseedURL" /></textarea>
|
||||||
|
<div class="formaction"><input type="submit" name="action" value="<%=intl._("Reset URL list")%>" /></div>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
<tr><td class="mediumtags" align="right"><b><%=intl._("Enable HTTP Proxy?")%></b></td>
|
<tr><td class="mediumtags" align="right"><b><%=intl._("Enable HTTP Proxy?")%></b></td>
|
||||||
<td><input type="checkbox" class="optbox" name="enable" value="true" <jsp:getProperty name="reseedHelper" property="enable" /> ></td></tr>
|
<td><input type="checkbox" class="optbox" name="enable" value="true" <jsp:getProperty name="reseedHelper" property="enable" /> ></td></tr>
|
||||||
|
Reference in New Issue
Block a user