* Console:
- More tagging - Show user-installed themes on configui.jsp - Fix reseed button spacing * GraphHelper cleanup * Susidns: add link to subscription faq
This commit is contained in:
@ -1,13 +1,15 @@
|
|||||||
package net.i2p.router.web;
|
package net.i2p.router.web;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class ConfigUIHelper extends HelperBase {
|
public class ConfigUIHelper extends HelperBase {
|
||||||
public ConfigUIHelper() {}
|
|
||||||
|
|
||||||
private static final String themes[] = {_x("classic"), _x("dark"), _x("light")};
|
|
||||||
|
|
||||||
public String getSettings() {
|
public String getSettings() {
|
||||||
StringBuilder buf = new StringBuilder(512);
|
StringBuilder buf = new StringBuilder(512);
|
||||||
String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
|
String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
|
||||||
|
Set<String> themes = themeSet();
|
||||||
for (String theme : themes) {
|
for (String theme : themes) {
|
||||||
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
|
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
|
||||||
if (theme.equals(current))
|
if (theme.equals(current))
|
||||||
@ -17,10 +19,28 @@ public class ConfigUIHelper extends HelperBase {
|
|||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return standard and user-installed themes, sorted (untranslated) */
|
||||||
|
private Set<String> themeSet() {
|
||||||
|
Set<String> rv = new TreeSet();
|
||||||
|
// add a failsafe even if we can't find any themes
|
||||||
|
rv.add(CSSHelper.DEFAULT_THEME);
|
||||||
|
File dir = new File(_context.getBaseDir(), "docs/themes/console");
|
||||||
|
File[] files = dir.listFiles();
|
||||||
|
if (files == null)
|
||||||
|
return rv;
|
||||||
|
for (int i = 0; i < files.length; i++) {
|
||||||
|
String name = files[i].getName();
|
||||||
|
if (files[i].isDirectory() && ! name.equals("images"))
|
||||||
|
rv.add(name);
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
private static final String langs[] = {"de", "en", "fr", "nl", "se", "zh"};
|
private static final String langs[] = {"de", "en", "fr", "nl", "se", "zh"};
|
||||||
private static final String xlangs[] = {_x("German"), _x("English"), _x("French"),
|
private static final String xlangs[] = {_x("German"), _x("English"), _x("French"),
|
||||||
_x("Dutch"), _x("Swedish"), _x("Chinese")};
|
_x("Dutch"), _x("Swedish"), _x("Chinese")};
|
||||||
|
|
||||||
|
/** todo sort by translated string */
|
||||||
public String getLangSettings() {
|
public String getLangSettings() {
|
||||||
StringBuilder buf = new StringBuilder(512);
|
StringBuilder buf = new StringBuilder(512);
|
||||||
String current = Messages.getLanguage(_context);
|
String current = Messages.getLanguage(_context);
|
||||||
|
@ -119,18 +119,9 @@ public class GraphHelper extends HelperBase {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
public String getPeerSummary() {
|
|
||||||
try {
|
|
||||||
_context.commSystem().renderStatusHTML(_out);
|
|
||||||
_context.bandwidthLimiter().renderStatusHTML(_out);
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
ioe.printStackTrace();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AlphaComparator implements Comparator {
|
/** inner class, don't bother reindenting */
|
||||||
|
private static class AlphaComparator implements Comparator {
|
||||||
public int compare(Object lhs, Object rhs) {
|
public int compare(Object lhs, Object rhs) {
|
||||||
SummaryListener l = (SummaryListener)lhs;
|
SummaryListener l = (SummaryListener)lhs;
|
||||||
SummaryListener r = (SummaryListener)rhs;
|
SummaryListener r = (SummaryListener)rhs;
|
||||||
@ -139,3 +130,5 @@ class AlphaComparator implements Comparator {
|
|||||||
return lName.compareTo(rName);
|
return lName.compareTo(rName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -287,9 +287,9 @@ public class SummaryBarRenderer {
|
|||||||
if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev);
|
if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev);
|
||||||
System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+"");
|
System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+"");
|
||||||
String uri = _helper.getRequestURI();
|
String uri = _helper.getRequestURI();
|
||||||
buf.append("<form action=\"").append(uri).append("\" method=\"GET\">\n");
|
buf.append("<p><form action=\"").append(uri).append("\" method=\"GET\">\n");
|
||||||
buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
|
buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
|
||||||
buf.append("<button type=\"submit\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form>\n");
|
buf.append("<button type=\"submit\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form></p>\n");
|
||||||
}
|
}
|
||||||
anotherLine = true;
|
anotherLine = true;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ package dummy;
|
|||||||
*/
|
*/
|
||||||
class Dummy {
|
class Dummy {
|
||||||
void dummy {
|
void dummy {
|
||||||
// wars
|
// wars for ConfigClientsHelper
|
||||||
_("addressbook");
|
_("addressbook");
|
||||||
_("i2psnark");
|
_("i2psnark");
|
||||||
_("i2ptunnel");
|
_("i2ptunnel");
|
||||||
@ -16,7 +16,7 @@ class Dummy {
|
|||||||
_("susidns");
|
_("susidns");
|
||||||
_("routerconsole");
|
_("routerconsole");
|
||||||
|
|
||||||
// clients, taken from clients.config
|
// clients, taken from clients.config, for ConfigClientsHelper
|
||||||
// note that if the wording changes in clients.config, we have to
|
// note that if the wording changes in clients.config, we have to
|
||||||
// keep the old string here as well for existing installs
|
// keep the old string here as well for existing installs
|
||||||
_("Web console");
|
_("Web console");
|
||||||
@ -35,5 +35,10 @@ class Dummy {
|
|||||||
_("eepsite");
|
_("eepsite");
|
||||||
// hardcoded in i2psnark
|
// hardcoded in i2psnark
|
||||||
_("I2PSnark");
|
_("I2PSnark");
|
||||||
|
|
||||||
|
// standard themes for ConfigUIHelper
|
||||||
|
_("classic");
|
||||||
|
_("dark");
|
||||||
|
_("light");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,12 +61,12 @@
|
|||||||
<input type="text" size="8" name="capacity" value="<%=capacity%>" />
|
<input type="text" size="8" name="capacity" value="<%=capacity%>" />
|
||||||
<input type="submit" name="action" value="<%=intl._("Adjust peer bonuses")%>" /></p></div>
|
<input type="submit" name="action" value="<%=intl._("Adjust peer bonuses")%>" /></p></div>
|
||||||
</form>
|
</form>
|
||||||
<a name="shitlist"> </a>
|
<a name="shitlist"> </a><h2><%=intl._("Banned Peers")%></h2>
|
||||||
<jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" />
|
<jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" />
|
||||||
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
|
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
|
||||||
<jsp:setProperty name="profilesHelper" property="writer" value="<%=out%>" />
|
<jsp:setProperty name="profilesHelper" property="writer" value="<%=out%>" />
|
||||||
<jsp:getProperty name="profilesHelper" property="shitlistSummary" />
|
<jsp:getProperty name="profilesHelper" property="shitlistSummary" />
|
||||||
<div class="wideload">
|
<div class="wideload"><h2><%=intl._("Banned IPs")%></h2>
|
||||||
<jsp:getProperty name="peerhelper" property="blocklistSummary" />
|
<jsp:getProperty name="peerhelper" property="blocklistSummary" />
|
||||||
|
|
||||||
</div><hr></div></div></body></html>
|
</div><hr></div></div></body></html>
|
||||||
|
@ -12,6 +12,6 @@
|
|||||||
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
|
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
|
||||||
<jsp:setProperty name="profilesHelper" property="writer" value="<%=out%>" />
|
<jsp:setProperty name="profilesHelper" property="writer" value="<%=out%>" />
|
||||||
<jsp:getProperty name="profilesHelper" property="profileSummary" />
|
<jsp:getProperty name="profilesHelper" property="profileSummary" />
|
||||||
<a name="shitlist"> </a>
|
<a name="shitlist"> </a><h2><%=intl._("Banned Peers")%></h2>
|
||||||
<jsp:getProperty name="profilesHelper" property="shitlistSummary" />
|
<jsp:getProperty name="profilesHelper" property="shitlistSummary" />
|
||||||
<hr></div></div></body></html>
|
<hr></div></div></body></html>
|
||||||
|
@ -71,6 +71,7 @@ The subscription file contains a list of (i2p) URLs. The addressbook application
|
|||||||
regularly (once per hour) checks this list for new eepsites. Those URLs simply contain the published hosts.txt
|
regularly (once per hour) checks this list for new eepsites. Those URLs simply contain the published hosts.txt
|
||||||
file of other people. The default subscription is the hosts.txt from www.i2p2.i2p, which is updated infrequently.
|
file of other people. The default subscription is the hosts.txt from www.i2p2.i2p, which is updated infrequently.
|
||||||
So it is a good idea to add additional subscriptions to sites that have the latest addresses.
|
So it is a good idea to add additional subscriptions to sites that have the latest addresses.
|
||||||
|
<a href="http://www.i2p2.i2p/faq.html#subscriptions">See the FAQ for a list of subscription URLs.</a>
|
||||||
</p>
|
</p>
|
||||||
</div><hr>
|
</div><hr>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2009-10-31 zzz
|
||||||
|
* Console:
|
||||||
|
- More tagging
|
||||||
|
- Show user-installed themes on configui.jsp
|
||||||
|
- Fix reseed button spacing
|
||||||
|
* GraphHelper cleanup
|
||||||
|
* Susidns: add link to subscription faq
|
||||||
|
|
||||||
2009-10-29 zzz
|
2009-10-29 zzz
|
||||||
* Console tag fixes, bundle script fix
|
* Console tag fixes, bundle script fix
|
||||||
* Add help target to build.xml
|
* Add help target to build.xml
|
||||||
|
@ -757,7 +757,8 @@ public class Blocklist {
|
|||||||
|
|
||||||
/** write directly to the stream so we don't OOM on a huge list */
|
/** write directly to the stream so we don't OOM on a huge list */
|
||||||
public void renderStatusHTML(Writer out) throws IOException {
|
public void renderStatusHTML(Writer out) throws IOException {
|
||||||
out.write("<h2>Banned IPs</h2>");
|
// move to the jsp
|
||||||
|
//out.write("<h2>Banned IPs</h2>");
|
||||||
Set singles = new TreeSet();
|
Set singles = new TreeSet();
|
||||||
singles.addAll(_singleIPBlocklist);
|
singles.addAll(_singleIPBlocklist);
|
||||||
if (singles.size() > 0) {
|
if (singles.size() > 0) {
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 9;
|
public final static long BUILD = 10;
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
||||||
|
@ -253,7 +253,8 @@ public class Shitlist {
|
|||||||
|
|
||||||
public void renderStatusHTML(Writer out) throws IOException {
|
public void renderStatusHTML(Writer out) throws IOException {
|
||||||
StringBuilder buf = new StringBuilder(1024);
|
StringBuilder buf = new StringBuilder(1024);
|
||||||
buf.append("<h2>Banned Peers</h2>");
|
// move to the jsp
|
||||||
|
//buf.append("<h2>Banned Peers</h2>");
|
||||||
Map<Hash, Entry> entries = new TreeMap(new HashComparator());
|
Map<Hash, Entry> entries = new TreeMap(new HashComparator());
|
||||||
|
|
||||||
entries.putAll(_entries);
|
entries.putAll(_entries);
|
||||||
|
Reference in New Issue
Block a user