]>
Commit | Line | Data |
---|---|---|
ef63dafd ER |
1 | <html> |
2 | <head> | |
2ff4e4d5 | 3 | <link rel="Shortcut Icon" href="//www.pld-linux.org/favicon.ico"/> |
ef63dafd | 4 | <title>PLD QA Reports</title> |
2ff4e4d5 | 5 | <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="//srcbuilder.pld-linux.org/th/style.css"> |
95dbdd8c ER |
6 | <style> |
7 | .hidden { display: none; } | |
8 | span#count { font-weight: bold; } | |
9 | </style> | |
ef63dafd ER |
10 | </head> |
11 | <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
12 | <script> | |
13 | jQuery(function($) { | |
14 | $('#q').on('change', function(e) { | |
15 | var el = e.target; | |
16 | var o = el.options; | |
17 | var v = o[o.selectedIndex].value; | |
18 | location.href = "?q=" + v; | |
19 | }); | |
95dbdd8c ER |
20 | |
21 | var $lines = $('#lines>li'); | |
22 | var $count = $('#count'); | |
23 | $('#filter').on('keyup', function() { | |
24 | var search = $(this).val(); | |
25 | var count = 0; | |
26 | $lines.each(function() { | |
27 | var $line = $(this); | |
28 | var text = $line.text(); | |
29 | var fn = text.match(search) && ++count ? 'removeClass' : 'addClass'; | |
30 | $line[fn]('hidden'); | |
31 | }); | |
32 | $count.html(count); | |
33 | }); | |
34 | $count.html($lines.length); | |
ef63dafd ER |
35 | }); |
36 | </script> | |
37 | <body> | |
38 | <?php | |
39 | ||
40 | $report = isset($_GET['q']) ? basename($_GET['q']) : null; | |
41 | $reports = array( | |
42 | "main" => "Main deps x86_64", | |
43 | "main-ready" => "Main ready deps x86_64", | |
44 | "main-ready-test" => "Main+ready+test deps x86_64", | |
45 | ||
46 | "main-i686" => "Main deps i686", | |
47 | "main-ready-i686" => "Main ready deps i686", | |
48 | "main-ready-test-i686" => "Main+ready+test deps i686", | |
49 | ||
34957462 ER |
50 | "main-x32" => "Main deps x32", |
51 | "main-ready-x32" => "Main ready deps x32", | |
52 | "main-ready-test-x32" => "Main+ready+test deps x32", | |
38f51586 ER |
53 | |
54 | "freshness" => "GIT vs FTP freshness", | |
55 | ||
56 | "lint-PLD" => "rpmlint: main", | |
57 | "lint-test" => "rpmlint: test", | |
58 | "lint-ready" => "rpmlint: ready", | |
ef63dafd ER |
59 | ); |
60 | ||
8e5b91b1 | 61 | function reports_selection($reports) { |
bf022007 | 62 | global $report; |
8e5b91b1 ER |
63 | echo "Select report:"; |
64 | echo "<select id=q name=q>\n"; | |
65 | foreach ($reports as $q => $title) { | |
66 | printf("<option value=%s %s>%s</option>\n", $q, $q == $report ? 'selected' :'', $title); | |
67 | } | |
68 | echo "</select>\n"; | |
ef63dafd | 69 | } |
ef63dafd | 70 | |
95dbdd8c ER |
71 | /** |
72 | * Create text input for filtering results | |
73 | */ | |
74 | function filter_box() { | |
75 | echo '<br>Filter results: <input id="filter">'; | |
76 | echo '<br><span id="count">?</span> errors'; | |
77 | } | |
78 | ||
8e5b91b1 | 79 | function format_report($report) { |
95dbdd8c | 80 | echo "<br>View the <a href=$report.txt>raw</a> report<br/>\n"; |
ef63dafd | 81 | $file = "$report.txt"; |
99eefd6f | 82 | $giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog'; |
95dbdd8c | 83 | echo '<ol id="lines">'; |
99eefd6f | 84 | foreach (file($file) as $line) { |
38f51586 | 85 | $line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) { |
99eefd6f ER |
86 | $package = basename($m['spec'], '.spec'); |
87 | $url = sprintf($giturl, $package); | |
3e190aa2 | 88 | return sprintf('<li><font color=red>%s</font> [<a href="%s">%s</a>] %s', $m['prefix'], $url, $m['spec'], $m['msg']); |
99eefd6f ER |
89 | }, $line); |
90 | echo $line, "<br/>\n"; | |
91 | } | |
3e190aa2 | 92 | echo '</ol>'; |
ef63dafd ER |
93 | } |
94 | ||
8e5b91b1 | 95 | reports_selection($reports); |
95dbdd8c | 96 | filter_box(); |
8e5b91b1 ER |
97 | if (isset($reports[$report])) { |
98 | format_report($report); | |
99 | } | |
100 | ||
ef63dafd ER |
101 | ?> |
102 | </body> | |
103 | </html> |