<link rel="Shortcut Icon" href="//www.pld-linux.org/favicon.ico"/>
<title>PLD QA Reports</title>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="//srcbuilder.pld-linux.org/th/style.css">
+ <style>
+ .hidden { display: none; }
+ span#count { font-weight: bold; }
+ </style>
</head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var v = o[o.selectedIndex].value;
location.href = "?q=" + v;
});
+
+ var $lines = $('#lines>li');
+ var $count = $('#count');
+ $('#filter').on('keyup', function() {
+ var search = $(this).val();
+ var count = 0;
+ $lines.each(function() {
+ var $line = $(this);
+ var text = $line.text();
+ var fn = text.match(search) && ++count ? 'removeClass' : 'addClass';
+ $line[fn]('hidden');
+ });
+ $count.html(count);
+ });
+ $count.html($lines.length);
});
</script>
<body>
echo "</select>\n";
}
+/**
+ * Create text input for filtering results
+ */
+function filter_box() {
+ echo '<br>Filter results: <input id="filter">';
+ echo '<br><span id="count">?</span> errors';
+}
+
function format_report($report) {
- echo "<a href=$report.txt>raw</a><br/>\n";
+ echo "<br>View the <a href=$report.txt>raw</a> report<br/>\n";
$file = "$report.txt";
$giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
- echo '<ol>';
+ echo '<ol id="lines">';
foreach (file($file) as $line) {
$line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) {
$package = basename($m['spec'], '.spec');
}
reports_selection($reports);
+filter_box();
if (isset($reports[$report])) {
format_report($report);
}