Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor logging #303

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 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 Expand Up @@ -233,6 +235,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;
}
Expand Down
Loading