Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added switches for the columns
borg-0300709b4c19051d
diff --git a/htroot/IndexMonitor.html b/htroot/IndexMonitor.htmlindex 38f744d9f..9dd0e8a75 100644--- a/htroot/IndexMonitor.html+++ b/htroot/IndexMonitor.html@@ -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&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&path=#[cachepath]#" class="small" title="#[urltitle]#">#[url]#</a>#(/available)#</td>+ #(/showURL)#+</tr>#{/indexed}#</table>diff --git a/htroot/IndexMonitor.java b/htroot/IndexMonitor.javaindex 2e99607ce..31196d51b 100644--- a/htroot/IndexMonitor.java+++ b/htroot/IndexMonitor.java@@ -61,22 +61,25 @@ 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();post.put("process", "0");}-+// find process numberint tabletype;try {@@ -84,7 +87,7 @@ public class IndexMonitor {} catch (NumberFormatException e) {tabletype = 0;}-+// check if authorization is needed and/or givenif (((tabletype > 0) && (tabletype < 6)) ||(post.containsKey("clearlist")) ||@@ -96,18 +99,18 @@ public class IndexMonitor {prop.put("AUTHENTICATE", "admin log-in");return prop;}- }else{+ } else {// force log-inprop.put("AUTHENTICATE", "admin log-in");return prop;}}-+// custom number of linesif (post.containsKey("count")) {- lines = Integer.parseInt(post.get("count", "40"));+ lines = Integer.parseInt(post.get("count", "500"));}-+// do the commandsif (post.containsKey("clearlist")) sb.wordIndex.loadedURL.clearStack(tabletype);if (post.containsKey("deleteentry")) {@@ -118,11 +121,23 @@ 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 tableif (tabletype == 0) {prop.put("table", 2);@@ -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) {@@ -201,7 +272,7 @@ public class IndexMonitor {// return rewrite propertiesreturn prop;}-+private static SimpleDateFormat dayFormatter = new SimpleDateFormat("yyyy/MM/dd", Locale.US);private static String daydate(Date date) {if (date == null) {