More UI layout enhancements to the config pages.
This commit is contained in:
@ -55,7 +55,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
else
|
||||
startWebApp(app);
|
||||
} else {
|
||||
addFormError("Unsupported " + _action);
|
||||
addFormError("Unsupported " + _action + ".");
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,18 +70,18 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
ca.disabled = val == null;
|
||||
}
|
||||
ClientAppConfig.writeClientAppConfig(_context, clients);
|
||||
addFormNotice("Client configuration saved successfully - restart required to take effect");
|
||||
addFormNotice("Client configuration saved successfully - restart required to take effect.");
|
||||
}
|
||||
|
||||
private void startClient(int i) {
|
||||
List clients = ClientAppConfig.getClientApps(_context);
|
||||
if (i >= clients.size()) {
|
||||
addFormError("Bad client index");
|
||||
addFormError("Bad client index.");
|
||||
return;
|
||||
}
|
||||
ClientAppConfig ca = (ClientAppConfig) clients.get(i);
|
||||
LoadClientAppsJob.runClient(ca.className, ca.clientName, LoadClientAppsJob.parseArgs(ca.args), _log);
|
||||
addFormNotice("Client " + ca.clientName + " started");
|
||||
addFormNotice("Client " + ca.clientName + " started.");
|
||||
}
|
||||
|
||||
private void saveWebAppChanges() {
|
||||
@ -98,7 +98,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
props.setProperty(name, "" + (val != null));
|
||||
}
|
||||
RouterConsoleRunner.storeWebAppProperties(props);
|
||||
addFormNotice("WebApp configuration saved successfully - restart required to take effect");
|
||||
addFormNotice("WebApp configuration saved successfully - restart required to take effect.");
|
||||
}
|
||||
|
||||
// Big hack for the moment, not using properties for directory and port
|
||||
@ -116,14 +116,14 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
path = new File(path, app + ".war");
|
||||
s.addWebApplication("/"+ app, path.getAbsolutePath()).start();
|
||||
// no passwords... initialize(wac);
|
||||
addFormNotice("WebApp <a href=\"/" + app + "/\">" + app + "</a> started");
|
||||
addFormNotice("WebApp <a href=\"/" + app + "/\">" + app + "</a> started.");
|
||||
} catch (Exception ioe) {
|
||||
addFormError("Failed to start " + app + " " + ioe);
|
||||
addFormError("Failed to start " + app + " " + ioe + ".");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
addFormError("Failed to find server");
|
||||
addFormError("Failed to find server.");
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public String getForm1() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th>Client</th><th>Run at Startup?</th><th>Start Now</th><th>Class and arguments</th></tr>\n");
|
||||
buf.append("<tr><th align=\"right\">Client</th><th>Run at Startup?</th><th>Start Now</th><th align=\"left\">Class and arguments</th></tr>\n");
|
||||
|
||||
List clients = ClientAppConfig.getClientApps(_context);
|
||||
for (int cur = 0; cur < clients.size(); cur++) {
|
||||
@ -31,7 +31,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public String getForm2() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th>WebApp</th><th>Run at Startup?</th><th>Start Now</th><th>Description</th></tr>\n");
|
||||
buf.append("<tr><th align=\"right\">WebApp</th><th>Run at Startup?</th><th>Start Now</th><th align=\"left\">Description</th></tr>\n");
|
||||
Properties props = RouterConsoleRunner.webAppProperties();
|
||||
Set keys = new TreeSet(props.keySet());
|
||||
for (Iterator iter = keys.iterator(); iter.hasNext(); ) {
|
||||
@ -47,7 +47,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
}
|
||||
|
||||
private void renderForm(StringBuilder buf, String index, String name, boolean urlify, boolean enabled, boolean ro, String desc) {
|
||||
buf.append("<tr><td>");
|
||||
buf.append("<tr><td class=\"mediumtags\" align=\"right\" width=\"25%\">");
|
||||
if (urlify && enabled) {
|
||||
String link = "/";
|
||||
if (! RouterConsoleRunner.ROUTERCONSOLE.equals(name))
|
||||
@ -56,16 +56,16 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
} else {
|
||||
buf.append(name);
|
||||
}
|
||||
buf.append("</td><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
|
||||
buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
|
||||
if (enabled) {
|
||||
buf.append("checked=\"true\" ");
|
||||
if (ro)
|
||||
buf.append("disabled=\"true\" ");
|
||||
}
|
||||
buf.append("/></td><td> ");
|
||||
buf.append("/></td><td align=\"center\" width=\"15%\">");
|
||||
if (!enabled) {
|
||||
buf.append("<button type=\"submit\" name=\"action\" value=\"Start ").append(index).append("\" >Start<span class=hide> ").append(index).append("</span></button>");
|
||||
}
|
||||
buf.append(" </td><td>").append(desc).append("</td></tr>\n");
|
||||
buf.append("</td><td align=\"left\" width=\"50%\">").append(desc).append("</td></tr>\n");
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package net.i2p.router.web;
|
||||
public class ConfigUIHelper extends HelperBase {
|
||||
public ConfigUIHelper() {}
|
||||
|
||||
private static final String themes[] = {"classic", "dark", "light"};
|
||||
private static final String themes[] = {"Classic", "Dark", "Light"};
|
||||
|
||||
public String getSettings() {
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
|
Reference in New Issue
Block a user