@@ -43,16 +42,18 @@
-
+
+
+
+
+
+
-
-
-
-
+
@@ -63,15 +64,16 @@
-
+
+
-
+
-
+
@@ -81,7 +83,8 @@
-
+
+
@@ -128,9 +131,9 @@
-
+
-
+
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java
index 18005a83e..a1204f393 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java
@@ -108,7 +108,7 @@ public class ConfigClientsHandler extends FormHandler {
int newClient = clients.size();
String newDesc = getString("desc" + newClient);
- if (newDesc != null) {
+ if (newDesc != null && newDesc.trim().length() > 0) {
// new entry
int spc = newDesc.indexOf(" ");
String clss = newDesc;
@@ -118,7 +118,7 @@ public class ConfigClientsHandler extends FormHandler {
args = newDesc.substring(spc + 1);
}
String name = getString("name" + newClient);
- if (name == null) name = "new client";
+ if (name == null || name.trim().length() <= 0) name = "new client";
ClientAppConfig ca = new ClientAppConfig(clss, name, args, 2*60*1000,
_settings.get(newClient + ".enabled") != null);
clients.add(ca);
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
index b6d253745..acef26f72 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
@@ -79,10 +79,12 @@ public class ConfigClientsHelper extends HelperBase {
buf.append("").append(_(name)).append("");
} else if (edit && !ro) {
buf.append(" 0)
+ buf.append(_(name));
buf.append("\" >");
} else {
- buf.append(_(name));
+ if (name.length() > 0)
+ buf.append(_(name));
}
buf.append(" \n");
- buf.append("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN ");
- buf.append("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN ");
- buf.append("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT\n");
+ buf.append("" + _("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN") + " ");
+ buf.append("" + _("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN") + " ");
+ buf.append("" + _("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT") + "\n");
return buf.toString();
}
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java
index e4de305c5..2d676bdac 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java
@@ -15,13 +15,32 @@ public class GraphHelper extends HelperBase {
private int _width;
private int _height;
private int _refreshDelaySeconds;
+
+ private static final String PROP_X = "routerconsole.graphX";
+ private static final String PROP_Y = "routerconsole.graphY";
+ private static final String PROP_REFRESH = "routerconsole.graphRefresh";
+ private static final String PROP_PERIODS = "routerconsole.graphPeriods";
+ private static final String PROP_EVENTS = "routerconsole.graphEvents";
+ private static final int DEFAULT_X = 250;
+ private static final int DEFAULT_Y = 100;
+ private static final int DEFAULT_REFRESH = 60;
+ private static final int DEFAULT_PERIODS = 60;
+ static final int MAX_X = 2048;
+ static final int MAX_Y = 1024;
+ private static final int MIN_REFRESH = 15;
public GraphHelper() {
- _periodCount = 60; // SummaryListener.PERIODS;
- _showEvents = false;
- _width = 250;
- _height = 100;
- _refreshDelaySeconds = 60;
+ }
+
+ /** set the defaults after we have a context */
+ @Override
+ public void setContextId(String contextId) {
+ super.setContextId(contextId);
+ _width = _context.getProperty(PROP_X, DEFAULT_X);
+ _height = _context.getProperty(PROP_Y, DEFAULT_Y);
+ _periodCount = _context.getProperty(PROP_PERIODS, DEFAULT_PERIODS);
+ _refreshDelaySeconds = _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH);
+ _showEvents = Boolean.valueOf(_context.getProperty(PROP_EVENTS)).booleanValue();
}
public void setPeriodCount(String str) {
@@ -29,13 +48,13 @@ public class GraphHelper extends HelperBase {
}
public void setShowEvents(boolean b) { _showEvents = b; }
public void setHeight(String str) {
- try { _height = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ try { _height = Math.min(Integer.parseInt(str), MAX_Y); } catch (NumberFormatException nfe) {}
}
public void setWidth(String str) {
- try { _width = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ try { _width = Math.min(Integer.parseInt(str), MAX_X); } catch (NumberFormatException nfe) {}
}
public void setRefreshDelay(String str) {
- try { _refreshDelaySeconds = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ try { _refreshDelaySeconds = Math.max(Integer.parseInt(str), MIN_REFRESH); } catch (NumberFormatException nfe) {}
}
public String getImages() {
@@ -102,7 +121,9 @@ public class GraphHelper extends HelperBase {
}
return "";
}
+
public String getForm() {
+ saveSettings();
try {
_out.write(" ");
_out.write(" |