diff --git a/htroot/Network.html b/htroot/Network.html index 9f8f4aa8c..7a869fea0 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -45,15 +45,13 @@ Hash
  Age
  #(/complete)# -Type
  +Info
  Release/
SVN

  -Contact
  Last
Seen

  < > UTC
Offset
  Uptime
  < > #Links
  < > #RWIs
  < > -accept
Crawl/
Index
  Sent
Words

  Sent
URLs

  Received
Words

  @@ -74,16 +72,13 @@ #[hash]# #[age]# #(/complete)# -#(type)#junior::senior::principal#(/type)# +#[info]# #[version]# -#(contact)#passive::direct#(/contact)# #[lastSeen]# #[utc]# #[uptime]# #[links]# #[words]# -#(acceptcrawl)#-::C#(/acceptcrawl)# /  - #(acceptindex)#-::I#(/acceptindex)# #[sI]# #[sU]# #[rI]# @@ -137,14 +132,12 @@ YaCy Cluster Indexing Speed: #[gppm]# Pages Per Minute (Accumulated PPM over Act - + - - @@ -155,14 +148,12 @@ YaCy Cluster Indexing Speed: #[gppm]# Pages Per Minute (Accumulated PPM over Act - + - - diff --git a/htroot/Network.java b/htroot/Network.java index aa09479d6..aa6e0215e 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -72,6 +72,8 @@ public class Network { final String mySeedType = yacyCore.seedDB.mySeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN); final boolean iAmActive = (mySeedType.equals(yacySeed.PEERTYPE_SENIOR) || mySeedType.equals(yacySeed.PEERTYPE_PRINCIPAL)); + final StringBuffer info = new StringBuffer(512); + if (overview) { long accActLinks = yacyCore.seedDB.countActiveURL(); long accActWords = yacyCore.seedDB.countActiveRWI(); @@ -98,30 +100,42 @@ public class Network { words = Long.parseLong(seed.get("ICount", "0")); } catch (Exception e) {links = 0; words = 0;} + // my-info prop.put("table_my-name", seed.get("Name", "-") ); if (yacyCore.seedDB.mySeed.isVirgin()) { - prop.put("table_my-type", 0); + info.append(""); } else if(yacyCore.seedDB.mySeed.isJunior()) { - prop.put("table_my-type", 1); + info.append(""); accPotLinks += links; accPotWords += words; } else if(yacyCore.seedDB.mySeed.isSenior()) { - prop.put("table_my-type", 2); + info.append(""); accActLinks += links; accActWords += words; } else if(yacyCore.seedDB.mySeed.isPrincipal()) { - prop.put("table_my-type", 3); + info.append(""); accActLinks += links; accActWords += words; } + if (seed.getFlagAcceptRemoteCrawl()) { + info.append(""); + } else { + info.append(""); + } + if (seed.getFlagAcceptRemoteIndex()) { + info.append(""); + } else { + info.append(""); + } + prop.put("table_my-info", info.toString()); + + myppm = seed.getPPM(); prop.put("table_my-version", seed.get("Version", "-")); prop.put("table_my-utc", seed.get("UTC", "-")); prop.put("table_my-uptime", serverDate.intervalToString(60000 * Long.parseLong(seed.get("Uptime", "")))); prop.put("table_my-links", groupDigits(Long.toString(links))); prop.put("table_my-words", groupDigits(Long.toString(words))); - prop.put("table_my-acceptcrawl", Integer.toString(seed.getFlagAcceptRemoteCrawl() ? 1 : 0) ); - prop.put("table_my-acceptindex", Integer.toString(seed.getFlagAcceptRemoteIndex() ? 1 : 0) ); prop.put("table_my-sI", groupDigits(seed.get(yacySeed.INDEX_OUT, "0"))); prop.put("table_my-sU", groupDigits(seed.get(yacySeed.URL_OUT, "0"))); prop.put("table_my-rI", groupDigits(seed.get(yacySeed.INDEX_IN, "0"))); @@ -256,9 +270,8 @@ public class Network { } String startURL; String wikiPage; - final StringBuffer alert = new StringBuffer(); int PPM; - while ((e.hasMoreElements()) && (conCount < maxCount)) { + while (e.hasMoreElements() && conCount < maxCount) { seed = (yacySeed) e.nextElement(); if (seed != null) { if (conCount >= maxCount) { break; } @@ -267,15 +280,15 @@ public class Network { } else { prop.put(STR_TABLE_LIST+conCount+"_dark", ((dark) ? 1 : 0) ); dark=!dark; } - alert.setLength(0); + info.setLength(0); if (updatedProfile.contains(seed.hash)) { - alert.append(""); + info.append(""); } if ((wikiPage = (String) updatedWiki.get(seed.hash)) == null) { prop.put(STR_TABLE_LIST+conCount+"_updatedWikiPage", ""); } else { prop.put(STR_TABLE_LIST+conCount+"_updatedWikiPage", "?page=" + wikiPage); - alert.append(""); + info.append(""); } try { PPM = Integer.parseInt(seed.get("ISpeed", "-")); @@ -283,15 +296,9 @@ public class Network { PPM = 0; } if (((startURL = (String) isCrawling.get(seed.hash)) != null) && (PPM >= 10)) { - alert.append(""); + info.append(""); } - prop.put(STR_TABLE_LIST+conCount+"_alert", alert.toString()); - long links; - long words; - try { - links = Long.parseLong(seed.get("LCount", "0")); - words = Long.parseLong(seed.get("ICount", "0")); - } catch (Exception exc) {links = 0; words = 0;} + prop.put(STR_TABLE_LIST+conCount+"_alert", info.toString()); prop.put(STR_TABLE_LIST+conCount+"_hash", seed.hash); String shortname = seed.get("Name", "deadlink"); if (shortname.length() > 20) { @@ -305,26 +312,52 @@ public class Network { prop.put(STR_TABLE_LIST+conCount+"_complete_port", seed.get("Port", "-") ); prop.put(STR_TABLE_LIST+conCount+"_complete_hash", seed.hash); prop.put(STR_TABLE_LIST+conCount+"_complete_age", seed.getAge()); - }else{ + } else { prop.put(STR_TABLE_LIST+conCount+"_complete", 0); } + + + info.setLength(0); if (seed.isJunior()) { - prop.put(STR_TABLE_LIST+conCount+"_type", 0); + if (seed.getFlagDirectConnect()) { + info.append(""); + } else { + info.append(""); + } } else if(seed.isSenior()){ - prop.put(STR_TABLE_LIST+conCount+"_type", 1); + if (seed.getFlagDirectConnect()) { + info.append(""); + } else { + info.append(""); + } } else if(seed.isPrincipal()) { - prop.put(STR_TABLE_LIST+conCount+"_type", 2); - prop.put(STR_TABLE_LIST+conCount+"_type_url", seed.get("seedURL", "http://nowhere/") ); + info.append(""); + if (seed.getFlagDirectConnect()) { + info.append(""); + } else { + info.append(""); + } + info.append(""); + } + if (seed.getFlagAcceptRemoteCrawl()) { + info.append(""); + } else { + info.append(""); + } + if (seed.getFlagAcceptRemoteIndex()) { + info.append(""); + } else { + info.append(""); } + prop.put(STR_TABLE_LIST+conCount+"_info", info.toString()); + + prop.put(STR_TABLE_LIST+conCount+"_version", yacy.combinedVersionString2PrettyString(seed.get("Version", "0.1"))); - prop.put(STR_TABLE_LIST+conCount+"_contact", (seed.getFlagDirectConnect() ? 1 : 0)); prop.put(STR_TABLE_LIST+conCount+"_lastSeen", (System.currentTimeMillis() - seed.getLastSeenTime()) / 1000 / 60); prop.put(STR_TABLE_LIST+conCount+"_utc", seed.get("UTC", "-")); prop.put(STR_TABLE_LIST+conCount+"_uptime", serverDate.intervalToString(60000 * Long.parseLong(seed.get("Uptime", "0")))); - prop.put(STR_TABLE_LIST+conCount+"_links", groupDigits(Long.toString(links))); - prop.put(STR_TABLE_LIST+conCount+"_words", groupDigits(Long.toString(words))); - prop.put(STR_TABLE_LIST+conCount+"_acceptcrawl", (seed.getFlagAcceptRemoteCrawl() ? 1 : 0) ); - prop.put(STR_TABLE_LIST+conCount+"_acceptindex", (seed.getFlagAcceptRemoteIndex() ? 1 : 0) ); + prop.put(STR_TABLE_LIST+conCount+"_links", groupDigits(seed.get("LCount", "0"))); + prop.put(STR_TABLE_LIST+conCount+"_words", groupDigits(seed.get("ICount", "0"))); prop.put(STR_TABLE_LIST+conCount+"_sI", groupDigits(seed.get(yacySeed.INDEX_OUT, "0"))); prop.put(STR_TABLE_LIST+conCount+"_sU", groupDigits(seed.get(yacySeed.URL_OUT, "0"))); prop.put(STR_TABLE_LIST+conCount+"_rI", groupDigits(seed.get(yacySeed.INDEX_IN, "0"))); @@ -356,17 +389,17 @@ public class Network { return prop; } - private static String groupDigits(String Number) { - long n; + private static String groupDigits(String sValue) { + long lValue; try { - if (Number.endsWith(".0")) { Number = Number.substring(0, Number.length() - 2); } // for Connects per hour, why float ? - n = Long.parseLong(Number); - } catch (Exception e) {n = 0;} - if (n == 0) { return "-"; } - final String s = Long.toString(n); - String t = ""; - for (int i = 0; i < s.length(); i++) { t = s.charAt(s.length() - i - 1) + (((i % 3) == 0) ? "." : "") + t; } - return t.substring(0, t.length() - 1); + if (sValue.endsWith(".0")) { sValue = sValue.substring(0, sValue.length() - 2); } // for Connects per hour, why float ? + lValue = Long.parseLong(sValue); + } catch (Exception e) {lValue = 0;} + if (lValue == 0) { return "-"; } + sValue = Long.toString(lValue); + String rValue = ""; + for (int i = 0; i < sValue.length(); i++) { rValue = sValue.charAt(sValue.length() - i - 1) + (((i % 3) == 0) ? "." : "") + rValue; } + return rValue.substring(0, rValue.length() - 1); } private static String groupDigits(long Number) { diff --git a/htroot/env/grafics/CrawlNo.gif b/htroot/env/grafics/CrawlNo.gif new file mode 100644 index 000000000..40de627ed Binary files /dev/null and b/htroot/env/grafics/CrawlNo.gif differ diff --git a/htroot/env/grafics/CrawlYes.gif b/htroot/env/grafics/CrawlYes.gif new file mode 100644 index 000000000..66ad18db5 Binary files /dev/null and b/htroot/env/grafics/CrawlYes.gif differ diff --git a/htroot/env/grafics/DHTReceiveNo.gif b/htroot/env/grafics/DHTReceiveNo.gif new file mode 100644 index 000000000..74da91a26 Binary files /dev/null and b/htroot/env/grafics/DHTReceiveNo.gif differ diff --git a/htroot/env/grafics/DHTReceiveYes.gif b/htroot/env/grafics/DHTReceiveYes.gif new file mode 100644 index 000000000..1ccfe7641 Binary files /dev/null and b/htroot/env/grafics/DHTReceiveYes.gif differ diff --git a/htroot/env/grafics/JuniorDirect.gif b/htroot/env/grafics/JuniorDirect.gif new file mode 100644 index 000000000..04eac03d7 Binary files /dev/null and b/htroot/env/grafics/JuniorDirect.gif differ diff --git a/htroot/env/grafics/JuniorPassive.gif b/htroot/env/grafics/JuniorPassive.gif new file mode 100644 index 000000000..afd577ed6 Binary files /dev/null and b/htroot/env/grafics/JuniorPassive.gif differ diff --git a/htroot/env/grafics/PrincipalDirect.gif b/htroot/env/grafics/PrincipalDirect.gif new file mode 100644 index 000000000..4c6d57226 Binary files /dev/null and b/htroot/env/grafics/PrincipalDirect.gif differ diff --git a/htroot/env/grafics/PrincipalPassive.gif b/htroot/env/grafics/PrincipalPassive.gif new file mode 100644 index 000000000..e0995eb62 Binary files /dev/null and b/htroot/env/grafics/PrincipalPassive.gif differ diff --git a/htroot/env/grafics/SeniorDirect.gif b/htroot/env/grafics/SeniorDirect.gif new file mode 100644 index 000000000..bf0d2dcd0 Binary files /dev/null and b/htroot/env/grafics/SeniorDirect.gif differ diff --git a/htroot/env/grafics/SeniorPassive.gif b/htroot/env/grafics/SeniorPassive.gif new file mode 100644 index 000000000..348a7f2d9 Binary files /dev/null and b/htroot/env/grafics/SeniorPassive.gif differ diff --git a/htroot/env/grafics/Virgin.gif b/htroot/env/grafics/Virgin.gif new file mode 100644 index 000000000..f6362c9b7 Binary files /dev/null and b/htroot/env/grafics/Virgin.gif differ
NameTypeInfo Version UTC Uptime #Links #RWIsAccept
Crawl
Accept
Index
Sent
Words
Sent
URLs
Received
Words
#[my-name]##(my-type)#virgin::junior::senior::principal#(/my-type)##[my-info]# #[my-version]# #[my-utc]# #[my-uptime]# #[my-links]# #[my-words]##(my-acceptcrawl)#no::yes#(/my-acceptcrawl)##(my-acceptindex)#no::yes#(/my-acceptindex)# #[my-sI]# #[my-sU]# #[my-rI]#