X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=7e1eb0ab94027c318b29e2b20b3fa3f6df1af6d3;hb=ec138f334f853def75f66fef8337adf2a6cc38b2;hp=da1e53ef1bd7b175b0a022e5697702591f6a0786;hpb=63695ac760202da049095299e456e8eb74b015dc;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index da1e53e..7e1eb0a 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,4 @@ -%# $Id: found.mc,v 1.17 2006-10-27 00:47:05 mike Exp $ +%# $Id: found.mc,v 1.22 2006-12-05 17:18:30 mike Exp $ <%once> sub print_navlink { my($params, $cond, $caption, $skip) = @_; @@ -19,6 +19,21 @@ 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> @@ -77,10 +92,10 @@ my $first = $skip+1; my $last = $first+$count-1; $last = $n if $last > $n; %perl> -
+% if ($n == 0) { No matches @@ -100,7 +115,7 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count);