diff --git a/htroot/Network.html b/htroot/Network.html index 4ad043da5..ee9336475 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -67,7 +67,8 @@ w  #[alert]# #[shortname]# -#(info)##(direct)#::#(/direct)#::#(direct)#::#(/direct)#::#(direct)#::#(/direct)##(/info)##(acceptcrawl)#::#(/acceptcrawl)##(dhtreceive)#::#(/dhtreceive)# + +#(type)##(direct)#::::#(/direct)#::#(direct)#::::#(/direct)#::#(direct)#::::#(/direct)##(/type)##(acceptcrawl)#::::#(/acceptcrawl)##(dhtreceive)#::::#(/dhtreceive)# #[version]# #[lastSeen]# #[utc]# @@ -89,6 +90,7 @@ #(/complete)# #{/list}# +

runtime: #[rt]# ms

:: @@ -204,5 +206,6 @@ To do this, press this button: #(/table)# #[footer]# + \ No newline at end of file diff --git a/htroot/Network.java b/htroot/Network.java index 644365bcb..a1c249a31 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -65,6 +65,8 @@ public class Network { private static final String STR_TABLE_LIST = "table_list_"; public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) { + long start = System.currentTimeMillis(); + // return variable that accumulates replacements final serverObjects prop = new serverObjects(); final boolean overview = (post == null) || (((String) post.get("page", "0")).equals("0")); @@ -309,24 +311,39 @@ public class Network { if (seed.isJunior()) { - prop.put(STR_TABLE_LIST + conCount + "_info", 0); + prop.put(STR_TABLE_LIST + conCount + "_type", 0); } else if(seed.isSenior()){ - prop.put(STR_TABLE_LIST + conCount + "_info", 1); + prop.put(STR_TABLE_LIST + conCount + "_type", 1); } else if(seed.isPrincipal()) { - prop.put(STR_TABLE_LIST + conCount + "_info", 2); + prop.put(STR_TABLE_LIST + conCount + "_type", 2); } - prop.put(STR_TABLE_LIST + conCount + "_info_url", seed.get("seedURL", "http://nowhere/")); + prop.put(STR_TABLE_LIST + conCount + "_type_url", seed.get("seedURL", "http://nowhere/")); long lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenTime()) / 1000 / 60); -// if (lastseen < 0) lastseen = 0; - if (page == 2 || lastseen > 1440) { // Passive Peers should be passive, also Peers without contact greater than an day - prop.put(STR_TABLE_LIST + conCount + "_info_direct", 0); - } else { - prop.put(STR_TABLE_LIST + conCount + "_info_direct", seed.getFlagDirectConnect() ? 1 : 0); + if (page == 2 || lastseen > 1440) { // Passive Peers should be passive, also Peers without contact greater than an day + // principal/senior/junior: red/red=offline + prop.put(STR_TABLE_LIST + conCount + "_type_direct", 2); + } else { + // principal/senior: green/green=direct or yellow/yellow=passive + // junior: red/green=direct or red/yellow=passive + prop.put(STR_TABLE_LIST + conCount + "_type_direct", seed.getFlagDirectConnect() ? 1 : 0); + } + + if (page == 1) { + prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0); // green=on or red=off + prop.put(STR_TABLE_LIST + conCount + "_dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0); // green=on or red=off + } else { // Passive, Potential Peers + if (seed.getFlagAcceptRemoteCrawl()) { + prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", 2); // red/green: offline, was on + } else { + prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", 0); // red/red; offline was off + } + if (seed.getFlagAcceptRemoteIndex()) { + prop.put(STR_TABLE_LIST + conCount + "_dhtreceive", 2); // red/green: offline, was on + } else { + prop.put(STR_TABLE_LIST + conCount + "_dhtreceive", 0); // red/red; offline was off + } } - prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0); - prop.put(STR_TABLE_LIST + conCount + "_dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0); - prop.put(STR_TABLE_LIST + conCount + "_version", yacy.combinedVersionString2PrettyString(seed.get("Version", "0.1"))); prop.put(STR_TABLE_LIST + conCount + "_lastSeen", lastseen); prop.put(STR_TABLE_LIST + conCount + "_utc", seed.get("UTC", "-")); @@ -359,6 +376,7 @@ public class Network { default: break; } } + prop.put("table_rt", System.currentTimeMillis() - start); // return rewrite properties return prop; } diff --git a/htroot/env/grafics/CrawlYesOffline.gif b/htroot/env/grafics/CrawlYesOffline.gif new file mode 100644 index 000000000..05d41b434 Binary files /dev/null and b/htroot/env/grafics/CrawlYesOffline.gif differ diff --git a/htroot/env/grafics/DHTReceiveYesOffline.gif b/htroot/env/grafics/DHTReceiveYesOffline.gif new file mode 100644 index 000000000..aa263078d Binary files /dev/null and b/htroot/env/grafics/DHTReceiveYesOffline.gif differ diff --git a/htroot/env/grafics/JuniorDirect.gif b/htroot/env/grafics/JuniorDirect.gif index 04eac03d7..6c19f3db9 100644 Binary files a/htroot/env/grafics/JuniorDirect.gif and b/htroot/env/grafics/JuniorDirect.gif differ diff --git a/htroot/env/grafics/JuniorOffline.gif b/htroot/env/grafics/JuniorOffline.gif new file mode 100644 index 000000000..afd577ed6 Binary files /dev/null and b/htroot/env/grafics/JuniorOffline.gif differ diff --git a/htroot/env/grafics/JuniorPassive.gif b/htroot/env/grafics/JuniorPassive.gif index c532ba1cc..c137d8d58 100644 Binary files a/htroot/env/grafics/JuniorPassive.gif and b/htroot/env/grafics/JuniorPassive.gif differ diff --git a/htroot/env/grafics/PrincipalOffline.gif b/htroot/env/grafics/PrincipalOffline.gif new file mode 100644 index 000000000..e0995eb62 Binary files /dev/null and b/htroot/env/grafics/PrincipalOffline.gif differ diff --git a/htroot/env/grafics/SeniorOffline.gif b/htroot/env/grafics/SeniorOffline.gif new file mode 100644 index 000000000..348a7f2d9 Binary files /dev/null and b/htroot/env/grafics/SeniorOffline.gif differ