diff options
Diffstat (limited to 'var/www/build.alpinelinux.org/htdocs/errors/index.lua')
-rw-r--r-- | var/www/build.alpinelinux.org/htdocs/errors/index.lua | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/var/www/build.alpinelinux.org/htdocs/errors/index.lua b/var/www/build.alpinelinux.org/htdocs/errors/index.lua new file mode 100644 index 0000000..a2d9897 --- /dev/null +++ b/var/www/build.alpinelinux.org/htdocs/errors/index.lua @@ -0,0 +1,140 @@ +#!/usr/bin/haserl --shell=lua +Content-type: text/html + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>Alpine Linux - build errors</title> + + <!-- jquery dataTables --> + <script type="text/javascript" src="jquery/dataTables/js/jquery.js"></script> + <script type="text/javascript" src="jquery/dataTables/js/jquery.dataTables.min.js"></script> + <link rel="stylesheet" type="text/css" href="jquery/dataTables/css/jquery.dataTables.min.css"> + <link rel="stylesheet" type="text/css" href="styles.css"> + + <script> + function filterGlobal () { + $('#list_table').DataTable().search( + $('#global_filter').val(), + $('#global_regex').prop('checked'), + $('#global_smart').prop('checked') + ).draw(); + } + + function filterColumn ( i ) { + $('#list_table').DataTable().column( i ).search( + $('#col'+i+'_filter').val(), + $('#col'+i+'_regex').prop('checked'), + $('#col'+i+'_smart').prop('checked') + ).draw(); + } + + $(document).ready(function(){ + var table = $('#list_table').DataTable( { + "order": [[ 5, "desc" ], [ 0, "asc" ], [ 1, "asc" ]], + "paging": false, + "aoColumns": [ + { "bSortable": false }, + null, + null, + null, + { "bSortable": false }, + null + ] + } ); + + $('input.global_filter').on( 'keyup click', function () { + filterGlobal(); + } ); + + $('input.column_filter').on( 'keyup click', function () { + filterColumn( $(this).parents('tr').attr('data-column') ); + } ); + }); + </script> +</head> +<body> + <h1>Alpine Linux - build errors</h1> + <div id="search_table_container"> + <!-- + <table id="search_table"> + <thead> + <tr> + <th>Target</th> + <th>Search text</th> + <th>Treat as regex</th> + <th>Use smart search</th> + </tr> + </thead> + <tbody> + <tr id="filter_global"> + <td class="left">Global search</td> + <td class="left"><input type="text" class="global_filter text" id="global_filter"></td> + <td class="center"><input type="checkbox" class="global_filter" id="global_regex"></td> + <td class="center"><input type="checkbox" class="global_filter" id="global_smart" checked="checked"></td> + </tr> + <tr id="filter_col1" data-column="0"> + <td class="left">hostname</td> + <td class="left"><input type="text" class="column_filter text" id="col0_filter"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col0_regex"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col0_smart" checked="checked"></td> + </tr> + <tr id="filter_col2" data-column="1"> + <td class="left">pkgname</td> + <td class="left"><input type="text" class="column_filter text text" id="col1_filter"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col1_regex"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col1_smart" checked="checked"></td> + </tr> + <tr id="filter_col3" data-column="2"> + <td class="left">reponame</td> + <td class="left"><input type="text" class="column_filter text" id="col2_filter"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col2_regex"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col2_smart" checked="checked"></td> + </tr> + <tr id="filter_col5" data-column="5"> + <td class="left">date</td> + <td class="left"><input type="text" class="column_filter text" id="col5_filter"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col5_regex"></td> + <td class="center"><input type="checkbox" class="column_filter" id="col5_smart" checked="checked"></td> + </tr> + </tbody> + </table> + --> + <table id="list_table" class="hover stripe order-column row-border cell-border"> + <thead> + <tr class="head"> + <th>hostname</th> + <th>pkgname</th> + <th>reponame</th> + <th>logurl</th> + <th>date (UTC)</th> + <th>comment</th> + </tr> + </thead> + <thead> + <tbody> + <% + sqlite3 = require "lsqlite3" + local dbfile = '/var/lib/build-errors/sqlite/build-errors.db' + local db = sqlite3.open(dbfile) + for r in db:nrows('select * from build_errors') do + tr = '\ + <tr><!-- id: '..r.id..' -->\ + <td class="nowrap">'..r.hostname..'</td>\ + <td class="nowrap">'..r.pkgname..'</td>\ + <td class="nowrap">'..r.reponame..'</td>\ + <td class="nowrap"><a href="'..r.logurl..'">logurl</a></td>\ + <td class="nowrap">'..r.datetime..'</td>\ + <td class="nowrap">'..r.comment..'</td>\ + </tr>\ + ' + print(tr) + end + db:close() + %> + </tbody> + </table> + </div> +</body> +</html> |