diff --git a/web/index.php b/web/index.php index 8bead0e5d81cf2869df594c5a9a3d558ef83b639..27d92bc55bd5919622037aa4f1778270216fd987 100644 --- a/web/index.php +++ b/web/index.php @@ -13,6 +13,13 @@ <title>eduGAIN Connectivity Check Service 2</title> </head> <body> + <hr> + <div id="status"> + <input type="checkbox" name="status" value="ERROR">ERROR + <input type="checkbox" name="status" value="OK">OK + <input type="checkbox" name="status" value="DISABLE">DISABLE + </div> + <hr> <div class="container"> <table id="eccstable" class="display" style="width:100%"> <thead> @@ -21,7 +28,6 @@ <th>DisplayName</th> <th>EntityID</th> <th>Registration Authority</th> - <th>Technical Contacts</th> <th>Check Date</th> <th>Status</th> </tr> diff --git a/web/script.js b/web/script.js index d40d29638b701e4e49c5ef18553e0eb0d7dc2469..2227645a2ca98e0fa2ebd72342988f5b9d4d301a 100644 --- a/web/script.js +++ b/web/script.js @@ -36,6 +36,8 @@ $(document).ready(function() { "url": "data.json", "dataSrc": "" }, + "lengthMenu": [[10, 20, 30, 40, 50, 100, -1], [10, 20, 30, 40, 50, 100, "All"]], + "autoWidth": false, "columns": [ { "className": 'details-control', @@ -50,14 +52,12 @@ $(document).ready(function() { { "data": "entityID" }, { "data": "registrationAuthority" }, { - "data": "contacts.technical", - "defaultContent": "" - }, - { "data": "date", + "data": "date", "width": "180px", "className": "dt-body-center" }, - { "data": "status", + { + "data": "status", "className": "dt-body-center" } ], @@ -91,4 +91,15 @@ $(document).ready(function() { tr.addClass('shown'); } } ); + + $('input:checkbox').on('change', function () { + //build a regex filter string with an or(|) condition + var sts = $('input:checkbox[name="status"]:checked').map(function() { + return this.value; + }).get().join('|'); + + //filter in column 5, with an regex, no smart filtering, not case sensitive + table.column(5).search(sts, true, false, false).draw(false); + }); + } );