added switches for the columns

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3700 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 18 years ago
parent 1d1685c588
commit 709b4c1905

@ -84,16 +84,8 @@
#(/size)#
</em></p>
<table cellpadding="2" cellspacing="1" >
<colgroup>
<col width="30" />
#(showInit)#::<col width="60" />#(/showInit)#
#(showExec)#::<col width="60" />#(/showExec)#
<col width="80" />
<col width="40" />
<col width="180" />
<col />
</colgroup>
<tr class="TableHeader">
#(showControl)#::
<td align="center">
<form action="#[feedbackpage]#" method="post" enctype="multipart/form-data">
<div>
@ -102,15 +94,17 @@
</div>
</form>
</td>
#(/showControl)#
#(showInit)#::<td><strong>Initiator</strong></td>#(/showInit)#
#(showExec)#::<td><strong>Executor</strong></td>#(/showExec)#
<td><strong>Modified Date</strong></td>
<td><strong>#Words</strong></td>
<td><strong>Title</strong></td>
<td><strong>URL</strong></td>
#(showDate)#::<td><strong>Modified</strong></td>#(/showDate)#
#(showWords)#::<td><strong>Words</strong></td>#(/showWords)#
#(showTitle)#::<td><strong>Title</strong></td>#(/showTitle)#
#(showURL)#::<td><strong>URL</strong></td>#(/showURL)#
</tr>
#{indexed}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#">
#(showControl)#::
<td align="center">
<form action="#[feedbackpage]#" method="post" enctype="multipart/form-data">
<div>
@ -120,11 +114,26 @@
</div>
</form>
</td>
#(/showControl)#
#(showInit)#::<td>#[initiatorSeed]#</td>#(/showInit)#
#(showExec)#::<td>#[executorSeed]#</td>#(/showExec)#
<td>#[moddate]#</td>
<td>#[wordcount]#</td>
<td>#[urldescr]#</td>
#(showDate)#::<td>#[modified]#</td>#(/showDate)#
#(showWords)#::<td>#[count]#</td>#(/showWords)#
#(showTitle)#
::
<td>
#(available)#
<span class="tt">-not cached-</span>
::
<a href="CacheAdmin_p.html?action=info&amp;path=#[cachepath]#" class="small" title="#[urltitle]#">#(nodescr)#no title::#[urldescr]##(/nodescr)#</a>
#(/available)#
</td>
#(/showTitle)#
#(showURL)#
::
<td>
#(available)#
<span class="tt">-not cached-</span>
@ -132,6 +141,8 @@
<a href="CacheAdmin_p.html?action=info&amp;path=#[cachepath]#" class="small" title="#[urltitle]#">#[url]#</a>
#(/available)#
</td>
#(/showURL)#
</tr>
#{/indexed}#
</table>

@ -61,16 +61,19 @@ import de.anomic.yacy.yacySeed;
public class IndexMonitor {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard sb = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
int lines = 40;
boolean showInit = false;
boolean showExec = false;
// return variable that accumulates replacements
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
final serverObjects prop = new serverObjects();
int lines = 500;
boolean showControl = env.getConfigBool("IndexMonitorControl", true);
boolean showInit = env.getConfigBool("IndexMonitorInit", false);
boolean showExec = env.getConfigBool("IndexMonitorExec", false);
boolean showDate = env.getConfigBool("IndexMonitorDate", true);
boolean showWords = env.getConfigBool("IndexMonitorWords", true);
boolean showTitle = env.getConfigBool("IndexMonitorTitle", true);
boolean showURL = env.getConfigBool("IndexMonitorURL", true);
if (post == null) {
post = new serverObjects();
@ -96,7 +99,7 @@ public class IndexMonitor {
prop.put("AUTHENTICATE", "admin log-in");
return prop;
}
}else{
} else {
// force log-in
prop.put("AUTHENTICATE", "admin log-in");
return prop;
@ -105,7 +108,7 @@ public class IndexMonitor {
// custom number of lines
if (post.containsKey("count")) {
lines = Integer.parseInt(post.get("count", "40"));
lines = Integer.parseInt(post.get("count", "500"));
}
// do the commands
@ -118,10 +121,22 @@ public class IndexMonitor {
}
}
if (post.containsKey("moreIndexed")) {
lines = Integer.parseInt(post.get("showIndexed", "40"));
lines = Integer.parseInt(post.get("showIndexed", "500"));
}
if (post.get("si") != null) showInit = true;
if (post.get("se") != null) showExec = true;
if (post.get("sc") != null)
if (post.get("sc").equals("0")) showControl = false; else showControl = true;
if (post.get("si") != null)
if (post.get("si").equals("0")) showInit = false; else showInit = true;
if (post.get("se") != null)
if (post.get("se").equals("0")) showExec = false; else showExec = true;
if (post.get("sd") != null)
if (post.get("sd").equals("0")) showDate = false; else showDate = true;
if (post.get("sw") != null)
if (post.get("sw").equals("0")) showWords = false; else showWords = true;
if (post.get("st") != null)
if (post.get("st").equals("0")) showTitle = false; else showTitle = true;
if (post.get("su") != null)
if (post.get("su").equals("0")) showURL = false; else showURL = true;
// create table
if (tabletype == 0) {
@ -138,10 +153,19 @@ public class IndexMonitor {
prop.put("table_size_count", lines);
}
prop.put("table_size_all", sb.wordIndex.loadedURL.getStackSize(tabletype));
prop.put("table_feedbackpage", "IndexMonitor.html");
prop.put("table_tabletype", tabletype);
if (showControl) {
prop.put("table_showControl", 1);
prop.put("table_showControl_feedbackpage", "IndexMonitor.html");
prop.put("table_showControl_tabletype", tabletype);
} else
prop.put("table_showControl", 0);
prop.put("table_showInit", (showInit) ? 1 : 0);
prop.put("table_showExec", (showExec) ? 1 : 0);
prop.put("table_showDate", (showDate) ? 1 : 0);
prop.put("table_showWords", (showWords) ? 1 : 0);
prop.put("table_showTitle", (showTitle) ? 1 : 0);
prop.put("table_showURL", (showURL) ? 1 : 0);
boolean dark = true;
String urlHash, initiatorHash, executorHash;
@ -171,24 +195,71 @@ public class IndexMonitor {
cachepath = cacheManager.getCachePath(new URL(urlstr)).toString().replace('\\', '/').substring(cacheManager.cachePath.toString().length() + 1);
prop.put("table_indexed_" + cnt + "_dark", (dark) ? 1 : 0);
prop.put("table_indexed_" + cnt + "_feedbackpage", "IndexMonitor.html");
prop.put("table_indexed_" + cnt + "_tabletype", tabletype);
prop.put("table_indexed_" + cnt + "_urlhash", urlHash);
prop.put("table_indexed_" + cnt + "_showInit", (showInit) ? 1 : 0);
prop.put("table_indexed_" + cnt + "_showInit_initiatorSeed", (initiatorSeed == null) ? "unknown" : initiatorSeed.getName());
prop.put("table_indexed_" + cnt + "_showExec", (showExec) ? 1 : 0);
prop.put("table_indexed_" + cnt + "_showExec_executorSeed", (executorSeed == null) ? "unknown" : executorSeed.getName());
prop.put("table_indexed_" + cnt + "_moddate", daydate(urle.moddate()));
prop.put("table_indexed_" + cnt + "_wordcount", urle.wordCount());
prop.put("table_indexed_" + cnt + "_urldescr", comp.title());
if (cachepath == null) {
prop.put("table_indexed_" + cnt + "_available", 0);
} else {
prop.put("table_indexed_" + cnt + "_available", 1);
prop.put("table_indexed_" + cnt + "_available_cachepath", cachepath);
prop.put("table_indexed_" + cnt + "_available_urltitle", urlstr);
prop.put("table_indexed_" + cnt + "_available_url", urltxt);
}
if (showControl) {
prop.put("table_indexed_" + cnt + "_showControl", 1);
prop.put("table_indexed_" + cnt + "_showControl_feedbackpage", "IndexMonitor.html");
prop.put("table_indexed_" + cnt + "_showControl_tabletype", tabletype);
prop.put("table_indexed_" + cnt + "_showControl_urlhash", urlHash);
} else
prop.put("table_indexed_" + cnt + "_showControl", 0);
if (showInit) {
prop.put("table_indexed_" + cnt + "_showInit", 1);
prop.put("table_indexed_" + cnt + "_showInit_initiatorSeed", (initiatorSeed == null) ? "unknown" : initiatorSeed.getName());
} else
prop.put("table_indexed_" + cnt + "_showInit", 0);
if (showExec) {
prop.put("table_indexed_" + cnt + "_showExec", 1);
prop.put("table_indexed_" + cnt + "_showExec_executorSeed", (executorSeed == null) ? "unknown" : executorSeed.getName());
} else
prop.put("table_indexed_" + cnt + "_showExec", 0);
if (showDate) {
prop.put("table_indexed_" + cnt + "_showDate", 1);
prop.put("table_indexed_" + cnt + "_showDate_modified", daydate(urle.moddate()));
} else
prop.put("table_indexed_" + cnt + "_showDate", 0);
if (showWords) {
prop.put("table_indexed_" + cnt + "_showWords", 1);
prop.put("table_indexed_" + cnt + "_showWords_count", urle.wordCount());
} else
prop.put("table_indexed_" + cnt + "_showWords", 0);
if (showTitle) {
prop.put("table_indexed_" + cnt + "_showTitle", (showTitle) ? 1 : 0);
if (cachepath == null) {
prop.put("table_indexed_" + cnt + "_showTitle_available", 0);
} else {
prop.put("table_indexed_" + cnt + "_showTitle_available", 1);
if (comp.title() == null || comp.title().trim().length() == 0)
prop.put("table_indexed_" + cnt + "_showTitle_available_nodescr", 0);
else
prop.put("table_indexed_" + cnt + "_showTitle_available_nodescr", 1);
prop.put("table_indexed_" + cnt + "_showTitle_available_nodescr_urldescr", comp.title());
prop.put("table_indexed_" + cnt + "_showTitle_available_cachepath", cachepath);
prop.put("table_indexed_" + cnt + "_showTitle_available_urltitle", urlstr);
}
} else
prop.put("table_indexed_" + cnt + "_showTitle", 0);
if (showURL) {
prop.put("table_indexed_" + cnt + "_showURL", 1);
if (cachepath == null) {
prop.put("table_indexed_" + cnt + "_showURL_available", 0);
} else {
prop.put("table_indexed_" + cnt + "_showURL_available", 1);
prop.put("table_indexed_" + cnt + "_showURL_available_cachepath", cachepath);
prop.put("table_indexed_" + cnt + "_showURL_available_urltitle", urlstr);
prop.put("table_indexed_" + cnt + "_showURL_available_url", urltxt);
}
} else
prop.put("table_indexed_" + cnt + "_showURL", 0);
dark = !dark;
cnt++;
} catch (Exception e) {

Loading…
Cancel
Save