From 988e88211b6cbe2317c76c69708950bbd345ea7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 17 Feb 2020 22:44:39 -0500 Subject: [PATCH] WIP --- views/systemlogs.html | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/views/systemlogs.html b/views/systemlogs.html index bee69fac9..2c59cdec8 100644 --- a/views/systemlogs.html +++ b/views/systemlogs.html @@ -2,6 +2,17 @@ {% block title %}Logs - Bazarr{% endblock %} +{% block head %} + +{% endblock head %} + {% block bcleft %}
@@ -141,11 +153,28 @@ $('#empty_button').on('click', function() { $.ajax({ url: "{{ url_for('emptylog') }}" - }).done(function (data) { + }).done(function () { table.ajax.reload(); table.columns.adjust().draw(false); }) }) + + $('.filter_log').on( 'click', function (e) { + e.preventDefault(); + $('.filter_log').removeClass('dropdown-item-checked'); + $(this).addClass('dropdown-item-checked'); + if ($(this).data('level') === 'INFO') { + table.column(0).search('INFO|WARNING|ERROR|DEBUG', true, false).draw(); + } else if ($(this).data('level') === 'WARNING') { + table.column(0).search('WARNING|ERROR|DEBUG', true, false).draw(); + } else if ($(this).data('level') === 'ERROR') { + table.column(0).search('ERROR|DEBUG', true, false).draw(); + } else if ($(this).data('level') === 'DEBUG') { + table.column(0).search('DEBUG', true, false).draw(); + } else if ($(this).data('level') === 'ALL') { + table.column(0).search('').draw(); + } + }); }) {% endblock tail %}