1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-03-18 17:55:54 +00:00

gui: Add the ability to filter the Add Indexer datatable (#11596)

This commit is contained in:
Wayne Dupree 2021-04-24 01:45:33 -05:00 committed by GitHub
parent e1aa849315
commit 62de0458e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

View file

@ -266,6 +266,32 @@ function displayUnconfiguredIndexersList() {
});
indexersTable.find("table").DataTable(
{
initComplete: function () {
this.api().columns().every(function () {
var column = this;
var headerText = column.header().innerText;
if (headerText == 'Language') {
var select = $('<select><option value="">Show all</option></select>')
.appendTo($(column.footer()).empty())
.on('change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search(val ? '^' + val + '$' : '', true, false)
.draw();
});
column.data().unique().sort().each(function (d, j) {
select.append('<option value="' + d + '">' + d + '</option>')
});
} else {
$(column.footer()).empty();
}
});
},
"stateSave": true,
"stateDuration": 0,
"fnStateSaveParams": function (oSettings, sValue) {
@ -1022,6 +1048,7 @@ function bindUIButtons() {
$('#jackett-add-indexer').click(function () {
$("#modals").empty();
displayUnconfiguredIndexersList();
$('#unconfigured-indexer-datatable tfoot tr').insertAfter($('#unconfigured-indexer-datatable thead tr'));
});
$("#jackett-test-all").click(function () {

View file

@ -375,7 +375,12 @@
</tbody>
<tfoot>
<tr>
<td colspan="6"></td>
<th>Indexer</th>
<th>Categories</th>
<th>Type</th>
<th>Type string</th>
<th>Language</th>
<th></th>
</tr>
</tfoot>
</table>
@ -693,6 +698,6 @@
</script>
<script type="text/javascript" src="../libs/api.js?changed=2017083001"></script>
<script type="text/javascript" src="../custom.js?changed=20210420"></script>
<script type="text/javascript" src="../custom.js?changed=20210423"></script>
</body>
</html>