Skip to content
Snippets Groups Projects
Commit 09b0a164 authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Improved Web Gui with Status Filter

parent 49b683db
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
<title>eduGAIN Connectivity Check Service 2</title> <title>eduGAIN Connectivity Check Service 2</title>
</head> </head>
<body> <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"> <div class="container">
<table id="eccstable" class="display" style="width:100%"> <table id="eccstable" class="display" style="width:100%">
<thead> <thead>
...@@ -21,7 +28,6 @@ ...@@ -21,7 +28,6 @@
<th>DisplayName</th> <th>DisplayName</th>
<th>EntityID</th> <th>EntityID</th>
<th>Registration Authority</th> <th>Registration Authority</th>
<th>Technical Contacts</th>
<th>Check Date</th> <th>Check Date</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
......
...@@ -36,6 +36,8 @@ $(document).ready(function() { ...@@ -36,6 +36,8 @@ $(document).ready(function() {
"url": "data.json", "url": "data.json",
"dataSrc": "" "dataSrc": ""
}, },
"lengthMenu": [[10, 20, 30, 40, 50, 100, -1], [10, 20, 30, 40, 50, 100, "All"]],
"autoWidth": false,
"columns": [ "columns": [
{ {
"className": 'details-control', "className": 'details-control',
...@@ -50,14 +52,12 @@ $(document).ready(function() { ...@@ -50,14 +52,12 @@ $(document).ready(function() {
{ "data": "entityID" }, { "data": "entityID" },
{ "data": "registrationAuthority" }, { "data": "registrationAuthority" },
{ {
"data": "contacts.technical", "data": "date",
"defaultContent": ""
},
{ "data": "date",
"width": "180px", "width": "180px",
"className": "dt-body-center" "className": "dt-body-center"
}, },
{ "data": "status", {
"data": "status",
"className": "dt-body-center" "className": "dt-body-center"
} }
], ],
...@@ -91,4 +91,15 @@ $(document).ready(function() { ...@@ -91,4 +91,15 @@ $(document).ready(function() {
tr.addClass('shown'); 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);
});
} ); } );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment