forked from I2P_Developers/i2p.i2p
Fix console getting disabled when saving client config (ticket #1260)
Router: Add warning at startup if console is disabled
This commit is contained in:
@@ -183,7 +183,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
for (int cur = 0; cur < clients.size(); cur++) {
|
||||
ClientAppConfig ca = clients.get(cur);
|
||||
Object val = _settings.get(cur + ".enabled");
|
||||
if (! ("webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName)))
|
||||
if (! (RouterConsoleRunner.class.getName().equals(ca.className)))
|
||||
ca.disabled = val == null;
|
||||
// edit of an existing entry
|
||||
String desc = getJettyString("desc" + cur);
|
||||
|
@@ -38,14 +38,23 @@ public class LoadClientAppsJob extends JobImpl {
|
||||
}
|
||||
List<ClientAppConfig> apps = ClientAppConfig.getClientApps(getContext());
|
||||
if (apps.isEmpty()) {
|
||||
_log.error("Warning - No client apps or router console configured - we are just a router");
|
||||
_log.logAlways(Log.WARN, "Warning - No client apps or router console configured - we are just a router");
|
||||
System.err.println("Warning - No client apps or router console configured - we are just a router");
|
||||
return;
|
||||
}
|
||||
for(int i = 0; i < apps.size(); i++) {
|
||||
ClientAppConfig app = (ClientAppConfig) apps.get(i);
|
||||
if (app.disabled)
|
||||
if (app.disabled) {
|
||||
if ("net.i2p.router.web.RouterConsoleRunner".equals(app.className)) {
|
||||
String s = "Warning - Router console is disabled. To enable,\n edit the file " +
|
||||
ClientAppConfig.configFile(getContext()) +
|
||||
",\n change the line \"clientApp." + i + ".startOnLoad=false\"" +
|
||||
" to \"clientApp." + i + ".startOnLoad=true\",\n and restart.";
|
||||
_log.logAlways(Log.WARN, s);
|
||||
System.err.println(s);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
String argVal[] = parseArgs(app.args);
|
||||
if (app.delay <= 0) {
|
||||
// run this guy now
|
||||
|
Reference in New Issue
Block a user