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

@ -31,7 +31,17 @@ public class ConfigStatsHandler extends FormHandler {
public void setFilename(String filename) {
_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) {
if (stat != null) {
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 setExplicitFilterValue(String filter) { _explicitFilterValue = filter; }

View File

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

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
* 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 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 long BUILD = 14;
public final static long BUILD = 15;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);