forked from I2P_Developers/i2p.i2p
switch from lists to a table
strip prefixes in each section CSS to follow
This commit is contained in:
@@ -52,6 +52,8 @@ public class ConfigAdvancedHelper extends HelperBase {
|
||||
sorted.putAll(_context.router().getConfigMap());
|
||||
boolean adv = isAdvanced();
|
||||
String lastType = null;
|
||||
if (!adv)
|
||||
buf.append("<table id=\"advcfgtable\">\n");
|
||||
for (Map.Entry<String, String> e : sorted.entrySet()) {
|
||||
String key = e.getKey();
|
||||
if (!adv) {
|
||||
@@ -64,23 +66,26 @@ public class ConfigAdvancedHelper extends HelperBase {
|
||||
if (dot > 0)
|
||||
type = type.substring(0, dot);
|
||||
if (!type.equals(lastType)) {
|
||||
if (lastType != null)
|
||||
buf.append("</ul>\n");
|
||||
lastType = type;
|
||||
String dtype = _headers.get(type);
|
||||
if (dtype == null)
|
||||
dtype = type;
|
||||
buf.append("<h4>").append(_t(dtype)).append("</h4>\n<ul><li>");
|
||||
} else {
|
||||
buf.append("<li>");
|
||||
dtype = DataHelper.escapeHTML(dtype);
|
||||
buf.append("<tr><th colspan=\"2\">[").append(_t(dtype)).append("]</th></tr>\n");
|
||||
}
|
||||
}
|
||||
String name = DataHelper.escapeHTML(key);
|
||||
String val = DataHelper.escapeHTML(e.getValue());
|
||||
buf.append(name).append('=').append(val).append('\n');
|
||||
if (adv) {
|
||||
buf.append(name).append('=').append(val).append('\n');
|
||||
} else {
|
||||
if (name.length() > lastType.length())
|
||||
name = name.substring(lastType.length() + 1);
|
||||
buf.append("<tr><td>").append(name).append("</td><td>").append(val).append("</td></tr>\n");
|
||||
}
|
||||
}
|
||||
if (!adv)
|
||||
buf.append("</ul>\n");
|
||||
buf.append("</table>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user