X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=9e858f862475897d1dd6bf2d817ec84480b0aa87;hb=HEAD;hp=7e1eb0ab94027c318b29e2b20b3fa3f6df1af6d3;hpb=9ce4f15f1b0949f2f38e4099a0a07f427c552fa7;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 7e1eb0a..9e858f8 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,3 @@ -%# $Id: found.mc,v 1.22 2006-12-05 17:18:30 mike Exp $ <%once> sub print_navlink { my($params, $cond, $caption, $skip) = @_; @@ -19,26 +18,11 @@ sub navlink { return $url; } -# Identical to the same-named function in full.mc -# So maybe this should go into IRSpy::Utils.pm? -# -sub calc_reliability { - 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 { &utf8param($r, $_) } &utf8param($r); my $query; if ($params{_query}) { $query = $params{_query}; @@ -52,7 +36,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) { @@ -69,8 +53,10 @@ if ($sort) { my $tried_to_open = 0; if (!defined $conn) { OPEN: - $conn = new ZOOM::Connection("localhost:3313/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; @@ -111,11 +97,12 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); % }
% if ($n > 0 && $first <= $n) { -# | Title | -Reliability | +Host Connection Reliability <& /help/link.mc, help => "info/reliability" &> + | Host | Port | DB | @@ -123,34 +110,33 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count);|
---|---|---|---|---|---|---|---|
<% $i %> | -"><% xml_encode($title, "[untitled]") %> | +"><% xml_encode($title) %> | <% xml_encode($reliability, "", { nbsp => 1 }) %> | <% xml_encode($host, "") %> | <% xml_encode($port, "") %> | <% xml_encode($db, "") %> | - " title="Test this target">Test " title="Edit this target's record">Edit " title="Raw XML record">XML |