mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
gui: Add the ability to filter the Add Indexer datatable (#11596)
This commit is contained in:
@@ -266,6 +266,32 @@ function displayUnconfiguredIndexersList() {
|
|||||||
});
|
});
|
||||||
indexersTable.find("table").DataTable(
|
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,
|
"stateSave": true,
|
||||||
"stateDuration": 0,
|
"stateDuration": 0,
|
||||||
"fnStateSaveParams": function (oSettings, sValue) {
|
"fnStateSaveParams": function (oSettings, sValue) {
|
||||||
@@ -1022,6 +1048,7 @@ function bindUIButtons() {
|
|||||||
$('#jackett-add-indexer').click(function () {
|
$('#jackett-add-indexer').click(function () {
|
||||||
$("#modals").empty();
|
$("#modals").empty();
|
||||||
displayUnconfiguredIndexersList();
|
displayUnconfiguredIndexersList();
|
||||||
|
$('#unconfigured-indexer-datatable tfoot tr').insertAfter($('#unconfigured-indexer-datatable thead tr'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#jackett-test-all").click(function () {
|
$("#jackett-test-all").click(function () {
|
||||||
|
@@ -375,7 +375,12 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6"></td>
|
<th>Indexer</th>
|
||||||
|
<th>Categories</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Type string</th>
|
||||||
|
<th>Language</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
@@ -693,6 +698,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../libs/api.js?changed=2017083001"></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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user