From 226aac88c54d5cb61e6795a48e263ad08e585f58 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 3 Apr 2015 11:52:03 -0700 Subject: [PATCH] web: error summary page tweaks --- html/ops/error_summary.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/html/ops/error_summary.php b/html/ops/error_summary.php index 5aee8d491a..fefe0ce3f8 100644 --- a/html/ops/error_summary.php +++ b/html/ops/error_summary.php @@ -22,6 +22,11 @@ require_once("../inc/util.inc"); require_once("../inc/result.inc"); +$ncodes = get_int('ncodes', true); +if (!$ncodes) $ncodes = 10; +$nresults_per_code = get_int('nresults_per_code', true); +if (!$nresults_per_code) $nresults_per_code = 10; + function compare ($x, $y) { return $x->count < $y->count; } @@ -38,7 +43,7 @@ foreach ($results as $r) { $error_codes[$e] = $x; } else { $x = new StdClass; - $x->count = 0; + $x->count = 1; $x->results = array($r); $error_codes[$e] = $x; } @@ -49,13 +54,13 @@ uasort($error_codes, 'compare'); page_head("Error summary"); $i = 0; foreach ($error_codes as $code => $x) { - if ($i++ > 10) break; - echo "

Exit status".exit_status_string($code)." ($x->count results)\n"; + if ($i++ >= $ncodes) break; + echo "

Exit status: ".exit_status_string($code)." ($x->count results)

\n"; $results = $x->results; $j = 0; foreach ($results as $r) { - if ($j++ > 10) break; - echo "
id>$r->id\n"; + if ($j++ >= $nresults_per_code) break; + echo " id>$r->id
\n"; } } page_tail();