Skip to content

Commit

Permalink
monitor log - keep page on update
Browse files Browse the repository at this point in the history
  • Loading branch information
rvyhnal committed Sep 23, 2024
1 parent 085a655 commit 4bf4836
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions intelmq_manager/static/js/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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) {
Expand All @@ -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() {
Expand Down

0 comments on commit 4bf4836

Please sign in to comment.