X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=231f4d10423049fcfb6d41f38f23da9f8582a46f;hp=3247f23d8d2ff56a3af026218bf68ac049d1e542;hb=5cb7ba44fc75fa61c3989e72d2831564a843283d;hpb=5dd9c46e9bd2d6bd99a0d2aa728ed5430aeec3e8 diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 3247f23..231f4d1 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,4 @@ -%# $Id: found.mc,v 1.25 2007-01-24 09:28:02 mike Exp $ +%# $Id: found.mc,v 1.33 2009-04-15 18:16:46 wosch Exp $ <%once> sub print_navlink { my($params, $cond, $caption, $skip) = @_; @@ -21,8 +21,9 @@ sub navlink { # 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_reliability { +sub calc_reliability2 { my($xc) = @_; my @allpings = $xc->findnodes("i:status/i:probe"); @@ -38,7 +39,7 @@ sub calc_reliability { our $conn = undef; <%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}; @@ -115,7 +116,8 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); # Title - Reliability + Host Connection Reliability <& /help/link.mc, help => "info/reliability" &> + Host Port DB @@ -126,28 +128,26 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); % foreach my $i ($first .. $last) { <%perl> my $xc = irspy_xpath_context($rs->record($i-1)); -my $title = $xc->find("e:databaseInfo/e:title"); -my $reliability = calc_reliability($xc); +my $title = $xc->find("e:databaseInfo/e:title") || "[UNTITLED]"; +my $reliability = calc_reliability2($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"); -my $id = $xc->find("concat(e:serverInfo/e:host, ':', - e:serverInfo/e:port, '/', - e:serverInfo/e:database)"); +my $id = irspy_record2identifier($xc); push @ids, $id; <% $i %> <% xml_encode($title, "[untitled]") %> + %>"><% 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 

- [Test all targets on this list]