X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=84735fc6693757a40ab5c7f7397b6bb70542256e;hp=156a7f216679d192b8c7b30c598987fe7cdde8cd;hb=3b5d2ddb73e9cc6750faff8d9463422ef69643d1;hpb=ba428e5d185c75364fab4a12603be9f27e3bd097 diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 156a7f2..84735fc 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,3 @@ -%# $Id: found.mc,v 1.31 2007-07-04 20:54:11 mike Exp $ <%once> sub print_navlink { my($params, $cond, $caption, $skip) = @_; @@ -19,27 +18,11 @@ 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; <%perl> -my %params = map { ( $_, utf8param($r, $_)) } grep { $r->param($_) } $r->param(); +my %params = map { ( $_, utf8param($r, $_)) } grep { &utf8param($r, $_) } &utf8param($r); my $query; if ($params{_query}) { $query = $params{_query}; @@ -70,8 +53,10 @@ if ($sort) { my $tried_to_open = 0; if (!defined $conn) { OPEN: - $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1"); + my $db = ZOOM::IRSpy::connect_to_registry(); + $conn = new ZOOM::Connection($db); $conn->option(elementSetName => "zeerex"); + $conn->option(count => 20); } my $rs; @@ -116,7 +101,7 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); # Title - Reliability <& /help/link.mc, help => "info/reliability" &> + Host Connection Reliability <& /help/link.mc, help => "info/reliability" &> Host Port @@ -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"); @@ -138,19 +124,19 @@ push @ids, $id; <% $i %> - "><% xml_encode($title) %> <% xml_encode($reliability, "", { nbsp => 1 }) %> <% xml_encode($host, "") %> <% xml_encode($port, "") %> <% xml_encode($db, "") %> - Test " title="Edit this target's record">Edit XML @@ -162,11 +148,11 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count);

[Test all targets on this list]

- [Statistics for targets on this list]

% }