Skip to content

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

better integration of server list in interactive search

orbiter8e03b8ee8b98
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 @@
</fieldset>
</form>
- #(servertable)#::
- <p>
- The following servers had been detected:
- </p>
- <form id="servertable" action="CrawlStartScanner_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8" ><fieldset>
- <legend><label for="servertable">Available server within the given IP range</label></legend>
- <table class="sortable" border="0" cellpadding="2" cellspacing="1">
- <tr class="TableHeader" valign="bottom">
- <th class="sorttable_nosort"><input type="checkbox" name="allswitch" onclick="checkAll(this.form.id, this.checked);" /></th>
- <th>Protocol</th>
- <th>IP</th>
- <th>URL</th>
- <th>Access</th>
- <th>Process</th>
- </tr>
- #{list}#
- <tr class="TableCellLight">
- <td align="left"><input type="checkbox" name="item_#[count]#" value="mark_#[pk]#" #(preselected)#::checked="checked"#(/preselected)# /></td>
- <td>#[protocol]#</td>
- <td><a href="#[url]#">#[ip]#</a></td>
- <td><a href="#[url]#">#[url]#</a></td>
- #(accessUnknown)#::<td class="info">unknown</td>#(/accessUnknown)#
- #(accessEmpty)#::<td class="info">empty</td>#(/accessEmpty)#
- #(accessGranted)#::<td class="commit">granted</td>#(/accessGranted)#
- #(accessDenied)#::<td class="error">denied</td>#(/accessDenied)#
- #(process)#<td class="info">not in index</td>::<td class="commit">indexed</td>#(/process)#
- </tr>
- #{/list}#
- </table>
- <p>
- <input type="hidden" name="num" value="#[num]#" />
- <input type="submit" name="crawl" value="Add Selected Servers to Crawler" />
- </p>
- </fieldset></form>
- #(/servertable)#
-
+ <iframe name="target"
+ src="/ServerScannerList.html?embedded=&edit="
+ width="100%"
+ height="410"
+ frameborder="0"
+ scrolling="auto"
+ id="target">
+ </iframe>
#%env/templates/footer.template%#
</body>
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<Map.Entry<Scanner.Service, Scanner.Access>> se = Scanner.scancacheEntries();
Map.Entry<Scanner.Service, Scanner.Access> 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<byte[], String> apiCommentCache = WorkTables.commentCache(sb);
-
- // show scancache table
- prop.put("servertable", 1);
- String urlString;
- DigestURI u;
- table: while (true) {
- try {
- int i = 0;
- final Iterator<Map.Entry<Scanner.Service, Scanner.Access>> se = Scanner.scancacheEntries();
- Map.Entry<Scanner.Service, Scanner.Access> 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 <a href="http://www.yacy-websuche.de
</div>
<div id="downloadscript" style="clear:both;"></div>
<div id="searchresults" style="clear:both;">
+<!-- <div><img src="PerformanceGraph.png" id="graph" alt="PerformanceGraph" width="660" height="240"/></div> -->
+</div>
+<div id="serverlist" style="clear:both;">
+#(serverlist)#::
<iframe name="target"
src="/ServerScannerList.html?embedded="
width="100%"
@@ -80,7 +84,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
scrolling="auto"
id="target">
</iframe>
-<!-- <div><img src="PerformanceGraph.png" id="graph" alt="PerformanceGraph" width="660" height="240"/></div> -->
+#(/serverlist)#
</div>
<script type="text/javascript">
//<![CDATA[
diff --git a/htroot/yacyinteractive.java b/htroot/yacyinteractive.java
index 3793a6062..8eb797b45 100644
--- a/htroot/yacyinteractive.java
+++ b/htroot/yacyinteractive.java
@@ -53,6 +53,7 @@ public class yacyinteractive {
prop.putHTML("startRecord", startRecord);
prop.putHTML("maximumRecords", maximumRecords);
prop.putHTML("querys", query.replaceAll(" ", "+"));
+ prop.put("serverlist", query.length() == 0 ? 1 : 0);
return prop;
}
}
\ No newline at end of file
diff --git a/source/net/yacy/cora/protocol/Scanner.java b/source/net/yacy/cora/protocol/Scanner.java
index 0ed9274cc..0cfa9fe84 100644
--- a/source/net/yacy/cora/protocol/Scanner.java
+++ b/source/net/yacy/cora/protocol/Scanner.java
@@ -105,7 +105,7 @@ public class Scanner extends Thread {
}
}
- private final static Map<Service, Access> scancache = new HashMap<Service, Access>();
+ private final static Map<Service, Access> scancache = new ConcurrentHashMap<Service, Access>();
//private static long scancacheUpdateTime = 0;
//private static long scancacheValidUntilTime = Long.MAX_VALUE;
private static Set<InetAddress> scancacheScanrange = new HashSet<InetAddress>();