X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=0f441969a6ed69f9571f2e181802ecd65ad54da1;hp=231f4d10423049fcfb6d41f38f23da9f8582a46f;hb=15207647aa476550214576f17062da61e250cf44;hpb=5be3dea6bacf251661cfa9b3317b3b62e01da295 diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 231f4d1..0f44196 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -19,22 +19,6 @@ 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; @@ -72,6 +56,7 @@ if (!defined $conn) { OPEN: $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1"); $conn->option(elementSetName => "zeerex"); + $conn->option(count => 20); } my $rs; @@ -125,11 +110,12 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); % my @ids; +% $rs->records($first-1, $last-$first+1); ## Force pre-cache % foreach my $i ($first .. $last) { <%perl> my $xc = irspy_xpath_context($rs->record($i-1)); my $title = $xc->find("e:databaseInfo/e:title") || "[UNTITLED]"; -my $reliability = calc_reliability2($xc); +my $reliability = calc_reliability_string($xc); my $host = $xc->find("e:serverInfo/e:host"); my $port = $xc->find("e:serverInfo/e:port"); my $db = $xc->find("e:serverInfo/e:database");