X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;fp=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=83801712b4d61e88fe449d553e7b0391b347e3ea;hp=13143c6f452c95d4277663c0f6785db0994eeb58;hb=bbfd131d8f1de160bd3b1f4731eed59222f13d65;hpb=eb807ae555c62e35d292c9eeba18b36917615a82 diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 13143c6..8380171 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; @@ -131,7 +115,7 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); <%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($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");