From 074dfd297b317f089a6522b024661cfff14fb5fb Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 9 Nov 2012 16:24:56 +0100 Subject: [PATCH] added icons and a selection for hosts with urls pending for crawler or with errors --- htroot/HostBrowser.html | 4 ++-- htroot/HostBrowser.java | 16 +++++++++++++--- htroot/env/grafics/burn-e.gif | Bin 0 -> 645 bytes htroot/env/grafics/construction.gif | Bin 0 -> 1991 bytes 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 htroot/env/grafics/burn-e.gif create mode 100644 htroot/env/grafics/construction.gif diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html index cdd665e60..6300ced0b 100644 --- a/htroot/HostBrowser.html +++ b/htroot/HostBrowser.html @@ -59,7 +59,7 @@ function updatepage(str) { #%env/templates/simpleheader.template%#

Host Browser

-

Browse the index of #[ucount]# documents. Enter a host or an URL for a file list or select one of a list of hosts.

+

Browse the index of #[ucount]# documents. Enter a host or an URL for a file list or view a list of all hosts, only hosts with urls pending in the crawler or only with load errors.

Host/URL: @@ -76,7 +76,7 @@ function updatepage(str) {
Host List #{list}#
- +
#[count]##(crawler)#::/#[pending]##(/crawler)##(errors)#::/#[count]##(/errors)# URLs
#{/list}# diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java index 7968d6a3e..abffd9a06 100644 --- a/htroot/HostBrowser.java +++ b/htroot/HostBrowser.java @@ -135,6 +135,9 @@ public class HostBrowser { if (post.containsKey("hosts")) { // generate host list try { + boolean onlyCrawling = "crawling".equals(post.get("hosts", "")); + boolean onlyErrors = "error".equals(post.get("hosts", "")); + int maxcount = admin ? 2 * 3 * 2 * 5 * 7 * 2 * 3 : 360; // which makes nice matrixes for 2, 3, 4, 5, 6, 7, 8, 9 rows/colums // collect hosts from index @@ -156,15 +159,22 @@ public class HostBrowser { String host; while (i.hasNext() && c < maxcount) { host = i.next(); - int errors = errorscore.get(host); prop.put("hosts_list_" + c + "_host", host); - prop.put("hosts_list_" + c + "_count", hostscore.get(host) - errors); boolean inCrawler = crawler.containsKey(host); + int errors = errorscore.get(host); + prop.put("hosts_list_" + c + "_count", hostscore.get(host) - errors); prop.put("hosts_list_" + c + "_crawler", inCrawler ? 1 : 0); if (inCrawler) prop.put("hosts_list_" + c + "_crawler_pending", crawler.get(host)[0]); prop.put("hosts_list_" + c + "_errors", errors > 0 ? 1 : 0); if (errors > 0) prop.put("hosts_list_" + c + "_errors_count", errors); - c++; + prop.put("hosts_list_" + c + "_type", inCrawler ? 2 : errors > 0 ? 1 : 0); + if (onlyCrawling) { + if (inCrawler) c++; + } else if (onlyErrors) { + if (errors > 0) c++; + } else { + c++; + } } prop.put("hosts_list", c); prop.put("hosts", 1); diff --git a/htroot/env/grafics/burn-e.gif b/htroot/env/grafics/burn-e.gif new file mode 100644 index 0000000000000000000000000000000000000000..788ed3daea9f7503ce57d943a5457cca115cd11b GIT binary patch literal 645 zcmZ?wbhEHblwc5G_{ePN;o-sX`)i+}U;g?LPg5nu9h`MSH7TNrOwZSYxL7V^#d z$>-iC`IBnREfJF>+COu;ia<=`Vn8yj5!resbF3zJmOU5PlJ|UH){~>UIn~)&muf73 zy;PdrBba2FBy(n&a3I87pvw@hL^anGhq>ud^A2(!FIwPsx970wkwwYxC*~NrbS&*C z)R^w$!U*=e2yRochQl23B?p(UyLWTznqLQ-doJZe!(rTOcQj4wA5O_q^Z5-(Nrd{xyN>DJ9M<@)zNnS^jvxj9Wp Sne6GL6?mik~H<%-j~1 zeN}jbCkK z0>VicH~-cfO?NE3(Di+s*)m~`7#HW0vr(_@VS6s+^1v}+=@B{KSX4VFTLsme&Xy-l zZYV8@s;x2dbq(B{V!ojuUejIrL~XN~qoxmMDdN)94|dEZ4v5k$v9~3oYC&0T?Q&j4 zLPu%1O!WQP5!cnS&E1u*#p!}uK4*I&_e0V=Ah@wx*J)bP$hB9#iPoZfwJ(!>@6$WD z;S-KdU0b?%bz#AIASr5I-s;HiO%Pnql3$i)injj=;p2a0{eS5X1xlZO3~UI~z5o1| z^m9<<@<5f-?wQKz$yQDmTsd8E<#fT7(*;*f7hE}An9BVp4xKJc=>8M8P8X(i|A}*_ z3zNJ5#KqGE7f%jr`rwfjrE==_P6L(J++&x`z_jC#PHgDC_T{sSdCqMoilqA;k zLgPeZllQe&UQmqEBkY~B#|#4JiI6_DFD-C<#oQ)+gQ@9gN@ISdrro4V*D2yZO&Nrz zKZ`sdGw7pziyGktnWTQ(@vy@E!?6Zu$mqaxUSHo_!n<9MGVfljn0;J4a=wdeS^m%* z(si>bZNysS&{)HiCEotF?v&~+QwrnPQ;mm0UaScUyoUOsV3W*lJ~!E7YCN-2)9RS+ WiRoRrm)fE