X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=f1540eafdf376dde5e625fc9ac79dae2a068cf15;hb=e928c1b78f0164b9c133baa8aea4716a708b7da8;hp=7c404f094a204470cc5e0d4d3cecd2f83b7b6768;hpb=3ef5b50122bfad64be196e00f1c1bf2b6ecc53ea;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 7c404f0..f1540ea 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,4 @@ -%# $Id: found.mc,v 1.21 2006-11-29 18:21:15 mike Exp $ +%# $Id: found.mc,v 1.32 2007-07-16 14:55:21 mike Exp $ <%once> sub print_navlink { my($params, $cond, $caption, $skip) = @_; @@ -19,11 +19,27 @@ sub navlink { return $url; } +# Identical to the same-named function in full.mc +# So maybe this should go into IRSpy::Utils.pm? +# Name changed (append 2) to prevent inadvertent clashes in Mason namespace +# +sub calc_reliability2 { + my($xc) = @_; + + my @allpings = $xc->findnodes("i:status/i:probe"); + my $nall = @allpings; + return "[untested]" if $nall == 0; + my @okpings = $xc->findnodes('i:status/i:probe[@ok = "1"]'); + my $nok = @okpings; + return "$nok/$nall = " . int(100*$nok/$nall) . "%"; +} + + # Just make this once; forge the connection on first use our $conn = undef; %once> <%perl> -my %params = map { ( $_, $r->param($_)) } grep { $r->param($_) } $r->param(); +my %params = map { ( $_, utf8param($r, $_)) } grep { $r->param($_) } $r->param(); my $query; if ($params{_query}) { $query = $params{_query}; @@ -37,7 +53,7 @@ if ($params{_query}) { $query .= "$key = ($val)"; } } -$query = 'cql.allRecords=x' if $query eq ""; +$query = 'cql.allRecords=1' if $query eq ""; my $sort = $params{"_sort"}; if ($sort) { @@ -54,7 +70,7 @@ if ($sort) { my $tried_to_open = 0; if (!defined $conn) { OPEN: - $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1"); + $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1"); $conn->option(elementSetName => "zeerex"); } @@ -100,7 +116,8 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count);