X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffull.mc;h=baec2605480dd143c5027c5fee75f8bcfc706c28;hp=abf5c01b3cb97c0ad17d750e4359a44b990b8457;hb=0ab30e7e20933507512444aed53bcb4ba84003b1;hpb=ede0de7215f54e2c51825ba8a43cc24ff996e533 diff --git a/web/htdocs/details/full.mc b/web/htdocs/details/full.mc index abf5c01..baec260 100644 --- a/web/htdocs/details/full.mc +++ b/web/htdocs/details/full.mc @@ -3,7 +3,8 @@ $id <%perl> -my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1"); +my $db = ZOOM::IRSpy::connect_to_registry(); +my $conn = new ZOOM::Connection($db); $conn->option(elementSetName => "zeerex"); my $query = cql_target($id); my $rs = $conn->search(new ZOOM::Query::CQL($query)); @@ -41,7 +42,7 @@ if ($n == 0) { [ "Implementation ID" => "i:status/i:implementationId" ], [ "Implementation Name" => "i:status/i:implementationName" ], [ "Implementation Version" => "i:status/i:implementationVersion" ], - [ "Reliability/reliability" => \&calc_reliability, $xc ], + [ "Reliability/reliability" => \&calc_reliability_wrapper, $xc ], [ "Services" => \&calc_init_options, $xc ], [ "Bib-1 Use attributes" => \&calc_ap, $xc, "bib-1" ], [ "Dan-1 Use attributes" => \&calc_ap, $xc, "dan-1" ], @@ -95,15 +96,9 @@ if ($n == 0) { % } <%perl> -sub calc_reliability { +sub calc_reliability_wrapper { my($id, $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) . "%"; + return calc_reliability_string($xc); } sub calc_init_options {