From 085a655a96bdf5ac081a67d1e1fd15f5595102fe Mon Sep 17 00:00:00 2001 From: Radek Vyhnal Date: Mon, 23 Sep 2024 12:22:44 +0200 Subject: [PATCH 1/2] log level ALL = CRITICAL --- intelmq_manager/static/js/monitor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/intelmq_manager/static/js/monitor.js b/intelmq_manager/static/js/monitor.js index 55f748e..5450438 100644 --- a/intelmq_manager/static/js/monitor.js +++ b/intelmq_manager/static/js/monitor.js @@ -233,6 +233,7 @@ function load_bot_log() { let bot_id = getUrlParameter('bot_id') || ALL_BOTS; let level = document.getElementById('log-level-indicator').value; + level = (level === 'ALL') ? 'CRITICAL' : level if(bot_id === ALL_BOTS) { return; } From 4bf48367c954f20f3f6ddd82104e665c3940da9d Mon Sep 17 00:00:00 2001 From: Radek Vyhnal Date: Mon, 23 Sep 2024 14:51:18 +0200 Subject: [PATCH 2/2] monitor log - keep page on update --- intelmq_manager/static/js/monitor.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/intelmq_manager/static/js/monitor.js b/intelmq_manager/static/js/monitor.js index 5450438..fd209b1 100644 --- a/intelmq_manager/static/js/monitor.js +++ b/intelmq_manager/static/js/monitor.js @@ -53,11 +53,13 @@ function redraw() { } function redraw_logs() { - $('#log-table').dataTable().fnClearTable(); + let logTable = $('#log-table').dataTable(); + let tPage = logTable.api().page(); + logTable.fnClearTable() if (bot_logs == {}) { - $('#log-table').dataTable().fnAdjustColumnSizing(); - $('#log-table').dataTable().fnDraw(); + logTable.fnAdjustColumnSizing(); + logTable.fnDraw(); return; } @@ -82,7 +84,7 @@ function redraw_logs() { log_row.DT_RowClass = LEVEL_CLASS[log_row.log_level]; - $('#log-table').dataTable().fnAddData(log_row); + logTable.fnAddData(log_row); if (has_button) { var extended_message_func = message_index => show_extended_message(message_index); document.getElementById(`button-extended-message-${index}`).addEventListener('click', function (index) { @@ -92,9 +94,9 @@ function redraw_logs() { }(index)) } } - - $('#log-table').dataTable().fnAdjustColumnSizing(); - $('#log-table').dataTable().fnDraw(); + logTable.fnAdjustColumnSizing(); + logTable.fnDraw(); + logTable.fnPageChange(tPage); } function redraw_queues() {