*) added peer-search to Network.html

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3347 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hydrox 18 years ago
parent 9c2101a852
commit faad869865

@ -30,6 +30,12 @@
<p>no remote #[peertype]# peer for this list known</p>
::
<p>Showing #[num]# entries from a total of #[total]# peers.</p>
<form action="Network.html?page=#[page]#" method="get" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
Search for a peername (RegExp allowed):
<input type="text" name="match" value="#[searchpattern]#" /><input type="hidden" name="page" value="#[page]#" /><input type="submit" name="search" value="Search" />
</fieldset>
</form>
<table class="networkTable" border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader" valign="bottom">
<td>send&nbsp;<strong>M</strong>essage/<br />show&nbsp;<strong>P</strong>rofile/<br />edit&nbsp;<strong>W</strong>iki<br />&nbsp;</td>

@ -7,7 +7,7 @@
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy: $
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -51,6 +51,8 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import de.anomic.http.httpHeader;
import de.anomic.http.httpc;
@ -294,9 +296,19 @@ public class Network {
int PPM;
double QPM;
long myValue=0, nextValue=0, prevValue=0, nextPPM=0, myPPM=0;
Pattern peerSearchPattern = null;
if(post.containsKey("search")) {
peerSearchPattern = Pattern.compile(post.get("match", ""));
}
while (e.hasMoreElements() && conCount < maxCount) {
seed = (yacySeed) e.nextElement();
if (seed != null) {
if(post.containsKey("search")) {
Matcher m = peerSearchPattern.matcher (seed.getName());
if (!m.find ()) {
continue;
}
}
prop.put(STR_TABLE_LIST + conCount + "_updatedProfile", 0);
prop.put(STR_TABLE_LIST + conCount + "_updatedWikiPage", 0);
prop.put(STR_TABLE_LIST + conCount + "_updatedBlog", 0);
@ -452,7 +464,7 @@ public class Network {
prop.put("table_total", ((page == 1) && (iAmActive)) ? (size + 1) : size );
prop.put("table_complete", ((complete)? 1 : 0) );
if( (!post.containsKey("order") && !post.containsKey("sort")) && page==1){
if( (!post.containsKey("order") && !post.containsKey("sort") && !post.containsKey("search")) && page==1){
int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100);
long indexdiff=nextValue-myValue;
long ppmdiff=myPPM-nextPPM;
@ -476,6 +488,7 @@ public class Network {
}
prop.put("page", page);
prop.put("table_page", page);
prop.put("table_searchpattern", post.get("match", ""));
switch (page) {
case 1 : prop.put("table_peertype", "senior/principal"); break;
case 2 : prop.put("table_peertype", "senior/principal"); break;

Loading…
Cancel
Save