From 8e03b8ee8b98e4592dd37e5f770f9281c0efc6af Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 12 Aug 2011 12:25:45 +0000 Subject: [PATCH] better integration of server list in interactive search git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7870 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/CrawlStartScanner_p.html | 44 ++++---------------- htroot/CrawlStartScanner_p.java | 47 ---------------------- htroot/js/yacyinteractive.js | 1 + htroot/yacyinteractive.html | 6 ++- htroot/yacyinteractive.java | 1 + source/net/yacy/cora/protocol/Scanner.java | 2 +- 6 files changed, 16 insertions(+), 85 deletions(-) diff --git a/htroot/CrawlStartScanner_p.html b/htroot/CrawlStartScanner_p.html index 8da7cc2a3..0e2088642 100644 --- a/htroot/CrawlStartScanner_p.html +++ b/htroot/CrawlStartScanner_p.html @@ -89,42 +89,14 @@ - #(servertable)#:: -

- The following servers had been detected: -

-
- - - - - - - - - - - #{list}# - - - - - - #(accessUnknown)#::#(/accessUnknown)# - #(accessEmpty)#::#(/accessEmpty)# - #(accessGranted)#::#(/accessGranted)# - #(accessDenied)#::#(/accessDenied)# - #(process)#::#(/process)# - - #{/list}# -
ProtocolIPURLAccessProcess
#[protocol]##[ip]##[url]#unknownemptygranteddeniednot in indexindexed
-

- - -

-
- #(/servertable)# - + #%env/templates/footer.template%# diff --git a/htroot/CrawlStartScanner_p.java b/htroot/CrawlStartScanner_p.java index 8a2b7816a..d33cca791 100644 --- a/htroot/CrawlStartScanner_p.java +++ b/htroot/CrawlStartScanner_p.java @@ -28,7 +28,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; -import net.yacy.cora.document.ASCII; import net.yacy.cora.protocol.Domains; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.Scanner; @@ -57,7 +56,6 @@ public class CrawlStartScanner_p { SearchEventCache.cleanupEvents(true); prop.put("noserverdetected", 0); - prop.put("servertable", 0); prop.put("hosts", ""); prop.put("intranet.checked", sb.isIntranetMode() ? 1 : 0); @@ -186,7 +184,6 @@ public class CrawlStartScanner_p { String urlString; DigestURI u; try { - int i = 0; final Iterator> se = Scanner.scancacheEntries(); Map.Entry host; while (se.hasNext()) { @@ -199,7 +196,6 @@ public class CrawlStartScanner_p { path += "&crawlingURL=" + urlString; WorkTables.execAPICall("localhost", (int) sb.getConfigLong("port", 8090), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, ""), path, u.hash()); } - i++; } catch (MalformedURLException e) { Log.logException(e); } @@ -210,49 +206,6 @@ public class CrawlStartScanner_p { } } - // write scan table - if (Scanner.scancacheSize() > 0) { - // make a comment cache - final Map apiCommentCache = WorkTables.commentCache(sb); - - // show scancache table - prop.put("servertable", 1); - String urlString; - DigestURI u; - table: while (true) { - try { - int i = 0; - final Iterator> se = Scanner.scancacheEntries(); - Map.Entry host; - while (se.hasNext()) { - host = se.next(); - try { - u = new DigestURI(host.getKey().url()); - urlString = u.toNormalform(true, false); - prop.put("servertable_list_" + i + "_pk", ASCII.String(u.hash())); - prop.put("servertable_list_" + i + "_count", i); - prop.putHTML("servertable_list_" + i + "_protocol", u.getProtocol()); - prop.putHTML("servertable_list_" + i + "_ip", host.getKey().getInetAddress().getHostAddress()); - prop.putHTML("servertable_list_" + i + "_url", urlString); - prop.put("servertable_list_" + i + "_accessUnknown", host.getValue() == Access.unknown ? 1 : 0); - prop.put("servertable_list_" + i + "_accessEmpty", host.getValue() == Access.empty ? 1 : 0); - prop.put("servertable_list_" + i + "_accessGranted", host.getValue() == Access.granted ? 1 : 0); - prop.put("servertable_list_" + i + "_accessDenied", host.getValue() == Access.denied ? 1 : 0); - prop.put("servertable_list_" + i + "_process", Scanner.inIndex(apiCommentCache, urlString) == null ? 0 : 1); - prop.put("servertable_list_" + i + "_preselected", host.getValue() == Access.granted && Scanner.inIndex(apiCommentCache, urlString) == null ? 1 : 0); - i++; - } catch (MalformedURLException e) { - Log.logException(e); - } - } - prop.put("servertable_list", i); - prop.put("servertable_num", i); - break table; - } catch (ConcurrentModificationException e) { - continue table; - } - } - } return prop; } diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js index 583597f97..715346be9 100644 --- a/htroot/js/yacyinteractive.js +++ b/htroot/js/yacyinteractive.js @@ -74,6 +74,7 @@ function preparepage(str) { document.getElementById("searchresults").innerHTML = resultList(); } document.getElementById("searchnavigation").innerHTML = resultNavigation(); + document.getElementById("serverlist").innerHTML = ""; hideDownloadScript(); } diff --git a/htroot/yacyinteractive.html b/htroot/yacyinteractive.html index fb00ebcc6..5e4b66f5f 100644 --- a/htroot/yacyinteractive.html +++ b/htroot/yacyinteractive.html @@ -72,6 +72,10 @@ To see a list of all APIs, please visit the
+ +
+
+#(serverlist)#:: - +#(/serverlist)#