2005-07-15 cervantes

* Added workaround for an odd win32 bug in the stats configuration
	  console page which meant only the first checkbox selection was saved.

2005-07-15  Romster
	* Added per group selection toggles in the stats configuration console
	  page.
This commit is contained in:
cervantes
2005-07-16 12:52:35 +00:00
committed by zzz
parent 9267d7cae2
commit 0f8ede85ca
4 changed files with 71 additions and 41 deletions

View File

@ -32,6 +32,16 @@ public class ConfigStatsHandler extends FormHandler {
_filename = (filename != null ? filename.trim() : null); _filename = (filename != null ? filename.trim() : null);
} }
public void setStatList(String stats[]) {
if (stats != null) {
for (int i = 0; i < stats.length; i++) {
String cur = stats[i].trim();
if ( (cur.length() > 0) && (!_stats.contains(cur)) )
_stats.add(cur);
}
}
}
public void setStatList(String stat) { public void setStatList(String stat) {
if (stat != null) { if (stat != null) {
if (stat.indexOf(',') != -1) { if (stat.indexOf(',') != -1) {
@ -48,15 +58,6 @@ public class ConfigStatsHandler extends FormHandler {
} }
} }
} }
public void setStatList(String stats[]) {
if (stats != null) {
for (int i = 0; i < stats.length; i++) {
String cur = stats[i].trim();
if ( (cur.length() > 0) && (!_stats.contains(cur)) )
_stats.add(cur);
}
}
}
public void setExplicitFilter(String foo) { _explicitFilter = true; } public void setExplicitFilter(String foo) { _explicitFilter = true; }
public void setExplicitFilterValue(String filter) { _explicitFilterValue = filter; } public void setExplicitFilterValue(String filter) { _explicitFilterValue = filter; }

View File

@ -5,32 +5,53 @@
<html><head> <html><head>
<title>I2P Router Console - config stats</title> <title>I2P Router Console - config stats</title>
<link rel="stylesheet" href="default.css" type="text/css" /> <link rel="stylesheet" href="default.css" type="text/css" />
<script language="JavaScript"> <script type="text/javascript">
function toggleAll(category) { function init()
//alert("toggle all for " + category); {
var shouldCheck = false; checkAll = false;
var shouldCheckDetermined = false; }
var elements = document.statsForm.elements; function toggleAll(category)
for (var i = 0; i < elements.length; i++) { {
//alert("cur element: " + i); var inputs = document.getElementsByTagName("input");
var curElement = elements.item(i); for(index = 0; index < inputs.length; index++)
//alert("cur elem: " + curElement); {
var curName = curElement.name; if(inputs[index].id == category)
//alert("cur name: " + curName); {
if (curName == 'statList') { if(inputs[index].checked == 0)
if (shouldCheckDetermined == false) { {
shouldCheckDetermined = true; inputs[index].checked = 1;
shouldCheck = !curElement.checked; }
} else if(inputs[index].checked == 1)
if (shouldCheck) {
curElement.checked = true; inputs[index].checked = 0;
else }
curElement.checked = false; }
} if(category == '*')
} {
if (checkAll == false)
{
inputs[index].checked = 1;
}
else if (checkAll == true)
{
inputs[index].checked = 0;
}
}
}
if(category == '*')
{
if (checkAll == false)
{
checkAll = true;
}
else if (checkAll == true)
{
checkAll = false;
}
}
} }
</script> </script>
</head><body> </head><body onLoad="init();">
<%@include file="nav.jsp" %> <%@include file="nav.jsp" %>
<%@include file="summary.jsp" %> <%@include file="summary.jsp" %>
@ -53,17 +74,17 @@ function toggleAll(category) {
<input type="hidden" name="action" value="foo" /> <input type="hidden" name="action" value="foo" />
<input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigStatsHandler.nonce")%>" /> <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigStatsHandler.nonce")%>" />
Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br /> Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br />
Filter: (<a href="javascript:toggleAll('*')">toggle all</a>)<br /> Filter: (<a href="javascript: void(null);" onclick="toggleAll('*')">toggle all</a>)<br />
<table> <table>
<% while (statshelper.hasMoreStats()) { <% while (statshelper.hasMoreStats()) {
while (statshelper.groupRequired()) { %> while (statshelper.groupRequired()) { %>
<tr><td valign="top" align="left" colspan="2"> <tr><td valign="top" align="left" colspan="2">
<b><%=statshelper.getCurrentGroupName()%></b> <b><%=statshelper.getCurrentGroupName()%></b>
<!--(<a href="javascript:toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>)--> (<a href="javascript: void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>)
</td></tr><% </td></tr><%
} // end iterating over required groups for the current stat %> } // end iterating over required groups for the current stat %>
<tr><td valign="top" align="left"> <tr><td valign="top" align="left">
<input type="checkbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <% <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td> if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td>
<td valign="top" align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br /> <td valign="top" align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br />
<%=statshelper.getCurrentStatDescription()%></td></tr><% <%=statshelper.getCurrentStatDescription()%></td></tr><%

View File

@ -1,4 +1,12 @@
$Id: history.txt,v 1.211 2005/07/13 13:20:43 jrandom Exp $ $Id: history.txt,v 1.212 2005/07/13 15:07:32 jrandom Exp $
2005-07-15 cervantes
* Added workaround for an odd win32 bug in the stats configuration
console page which meant only the first checkbox selection was saved.
2005-07-15 Romster
* Added per group selection toggles in the stats configuration console
page.
2005-07-13 jrandom 2005-07-13 jrandom
* Fixed a recently injected bug in the multitransport bidding which had * Fixed a recently injected bug in the multitransport bidding which had

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
* *
*/ */
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.202 $ $Date: 2005/07/13 13:20:43 $"; public final static String ID = "$Revision: 1.203 $ $Date: 2005/07/13 15:07:32 $";
public final static String VERSION = "0.5.0.7"; public final static String VERSION = "0.5.0.7";
public final static long BUILD = 14; public final static long BUILD = 15;
public static void main(String args[]) { public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION); System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID); System.out.println("Router ID: " + RouterVersion.ID);