Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Allow to hide linkstructure graphic in crawl monitor using/setting the config param DECORATION_GRAFICS_LINKSTRUCTURE

reger0260d3d800bb
diff --git a/htroot/Crawler_p.html b/htroot/Crawler_p.html
index 29067ece7..dc96d9de5 100644
--- a/htroot/Crawler_p.html
+++ b/htroot/Crawler_p.html
@@ -218,37 +218,50 @@ window.setInterval("setTableSize()", 1000);
<!-- crawl profile list -->
#(crawlProfilesShow)#::
<fieldset>
-<legend>Running Crawls (#[count]#)</legend>
-<table border="0" summary="A list of crawl profiles and their current settings.">
- <colgroup>
- <col width="16" />
- <col width="140"/>
- </colgroup>
- <tr class="TableHeader">
- <td><strong>Name</strong></td>
- #(debug)#::<td><strong>Count</strong></td>#(/debug)#
- <td><strong>Status</strong></td>
- </tr>
- #{list}#
- <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
- <td>#[name]#</td>
- #(debug)#::<td>#[count]#</td>#(/debug)#
- <td>#(terminateButton)#::
+ <legend>Running Crawls (#[count]#)</legend>
+<table width="96%">
+<tr><td>
+ <table border="0" summary="A list of crawl profiles and their current settings.">
+ <colgroup>
+ <col width="16" />
+ <col width="140"/>
+ </colgroup>
+ <tr class="TableHeader">
+ <td><strong>Name</strong></td>
+ #(debug)#::<td><strong>Count</strong></td>#(/debug)#
+ <td><strong>Status</strong></td>
+ </tr>
+ #{list}#
+ <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
+ <td>#[name]#</td>
+ #(debug)#::<td>#[count]#</td>#(/debug)#
+ <td>#(terminateButton)#::
<div style="text-decoration:blink;float:left;">Running</div>
<form style="float:left;" action="Crawler_p.html" method="get" enctype="multipart/form-data" accept-charset="UTF-8"><div>
<input type="hidden" name="handle" value="#[handle]#" />
<input type="submit" name="terminate" value="Terminate" class="btn btn-danger btn-xs"/>
</div></form>
#(/terminateButton)#
- </td>
- </tr>
- #{/list}#
-</table>
-#(linkstructure)#::
+ </td>
+ </tr>
+ #{/list}#
+ </table>
+</td>
+#(linkstructure)#
+<td>
+ <form style="float:right;" action="Crawler_p.html"><input type="submit" name="showwebstructuregraph" class="btn btn-default btn-xs" value="show link structure"/><form>
+</td></tr></table>
+::
+<td>
+ <form style="float:right;" action="Crawler_p.html"><input type="submit" name="hidewebstructuregraph" class="btn btn-default btn-xs" value="hide graphic"/><form>
+</td></tr></table>
<script src="/js/d3.v3.min.js"></script>
<script src="/js/hypertree.js"></script>
<div id="linkstructure"></div>
<script>$(document).ready(linkstructure("#[hosts]#", "#linkstructure", 1280, 720, 3000, 700));</script>::
+<td>
+ <form style="float:right;" action="Crawler_p.html"><input type="submit" name="hidewebstructuregraph" class="btn btn-default btn-xs" value="hide graphic"/><form>
+</td></tr></table>
<script type="text/javascript">
imagestub = "WebStructurePicture_p.png?host=#[hosts]#&depth=4&width=1024&height=512&nodes=600&time=1000&colortext=888888&colorback=FFFFFF&colordot0=1111BB&colordota=11BB11&colorline=222222&colorlineend=333333";
idx = 0;
diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.java
index a50c4e989..58c0a830a 100644
--- a/htroot/Crawler_p.java
+++ b/htroot/Crawler_p.java
@@ -674,7 +674,11 @@ public class Crawler_p {
prop.put("crawlProfilesShow", count == 0 ? 0 : 1);
prop.put("crawlProfilesShow_linkstructure", 0);
-
+
+ if (post != null) { // handle config button to display graphic
+ if (post.get("hidewebstructuregraph") != null) sb.setConfig(SwitchboardConstants.DECORATION_GRAFICS_LINKSTRUCTURE, false);
+ if (post.get("showwebstructuregraph") != null) sb.setConfig(SwitchboardConstants.DECORATION_GRAFICS_LINKSTRUCTURE, true);
+ }
if (count > 0 && sb.getConfigBool(SwitchboardConstants.DECORATION_GRAFICS_LINKSTRUCTURE, true)) {
// collect the host names for 'wide' crawls which can be visualized
boolean showLinkstructure = hosts.length() > 0 && !hosts.contains("file:");
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index bb8f530a5..29ebb0c6d 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -181,7 +181,7 @@ function updatepage(str) {
</table>
</fieldset>
- #(linkgraph)#::
+ #(linkgraph)#<div align="center"><form><input name="showlinkstructure" onClick="location.href = location.toString() + '&showlinkstructure=';" class="btn btn-default btn-xs" value="show link structure graph"/></form></div>::
<script src="/js/d3.v3.min.js"></script>
<script src="/js/hypertree.js"></script>
<div id="linkstructure"></div>
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index e0241a89e..e7bd5f0c7 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -568,6 +568,9 @@ public class HostBrowser {
prop.put("files_subpathdetectedsize", filecounter - storedDocs.size());
prop.put("files", 1);
uri = new DigestURL(path);
+ if (post.containsKey("showlinkstructure")) {
+ sb.setConfig(SwitchboardConstants.DECORATION_GRAFICS_LINKSTRUCTURE, true);
+ }
prop.put("files_linkgraph", uri.getPath().length() <= 1 && hostsize > 0 && sb.getConfigBool(SwitchboardConstants.DECORATION_GRAFICS_LINKSTRUCTURE, true));
prop.put("files_linkgraph_host", uri.getHost());