Fixes: First line was missing in logs. Adds support for Fail2ban container

This commit is contained in:
andryyy
2017-06-24 00:07:53 +02:00
parent b8e9b3d879
commit c75ce5124c
4 changed files with 85 additions and 3 deletions

View File

@@ -43,6 +43,10 @@ jQuery(function($){
e.preventDefault();
draw_sogo_logs();
});
$("#refresh_fail2ban_log").on('click', function(e) {
e.preventDefault();
draw_fail2ban_logs();
});
$("#refresh_rspamd_history").on('click', function(e) {
e.preventDefault();
draw_rspamd_history();
@@ -95,6 +99,41 @@ jQuery(function($){
}
});
}
function draw_fail2ban_logs() {
ft_fail2ban_logs = FooTable.init('#fail2ban_log', {
"columns": [
{"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}},
{"name":"message","title":lang.message},
],
"rows": $.ajax({
dataType: 'json',
url: '/api/v1/get/logs/fail2ban/1000',
jsonp: false,
error: function () {
console.log('Cannot draw fail2ban log table');
},
success: function (data) {
$.each(data, function (i, item) {
item.message = escapeHtml(item.message);
});
}
}),
"empty": lang.empty,
"paging": {
"enabled": true,
"limit": 5,
"size": log_pagination_size
},
"filtering": {
"enabled": true,
"position": "left",
"placeholder": lang.filter_table
},
"sorting": {
"enabled": true
}
});
}
function draw_sogo_logs() {
ft_sogo_logs = FooTable.init('#sogo_log', {
"columns": [
@@ -454,6 +493,7 @@ jQuery(function($){
draw_postfix_logs();
draw_dovecot_logs();
draw_sogo_logs();
draw_fail2ban_logs();
draw_domain_admins();
draw_fwd_hosts();
draw_rspamd_history();