[Web] Fix log line handling
[Web] Add mailcow UI logs [Web] Changes to _SESSION['return'] logic and logger (more to come) [Web] Show last login [Web, Postfix] Allow to disable sender check completely [Web] Many minor fixes [Web] Update some libs
This commit is contained in:
@@ -125,6 +125,7 @@ jQuery(function($){
|
||||
});
|
||||
} else if (table == 'domainadminstable') {
|
||||
$.each(data, function (i, item) {
|
||||
item.selected_domains = escapeHtml(item.selected_domains.toString().replace(/,/g, " "));
|
||||
item.chkbox = '<input type="checkbox" data-id="domain_admins" name="multi_select" value="' + item.username + '" />';
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit.php?domainadmin=' + encodeURI(item.username) + '" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-pencil"></span> ' + lang.edit + '</a>' +
|
||||
|
@@ -135,7 +135,7 @@ jQuery(function($){
|
||||
{"name":"uri","title":"URI","style":{"width":"310px"}},
|
||||
{"name":"method","title":"Method","style":{"width":"80px"}},
|
||||
{"name":"remote","title":"IP","style":{"width":"80px"}},
|
||||
{"name":"data","title":"Data","style":{"word-break":"break-all"}},
|
||||
{"name":"data","title":"Data","breakpoints": "all","style":{"word-break":"break-all"}},
|
||||
],
|
||||
"rows": $.ajax({
|
||||
dataType: 'json',
|
||||
@@ -162,6 +162,42 @@ jQuery(function($){
|
||||
}
|
||||
});
|
||||
}
|
||||
function draw_ui_logs() {
|
||||
ft_api_logs = FooTable.init('#ui_logs', {
|
||||
"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":"type","title":"Type"},
|
||||
{"name":"user","title":"User"},
|
||||
{"name":"role","title":"Role"},
|
||||
{"name":"remote","title":"IP"},
|
||||
{"name":"msg","title":lang.message},
|
||||
{"name":"call","title":"Call","breakpoints": "all"},
|
||||
],
|
||||
"rows": $.ajax({
|
||||
dataType: 'json',
|
||||
url: '/api/v1/get/logs/ui',
|
||||
jsonp: false,
|
||||
error: function () {
|
||||
console.log('Cannot draw ui log table');
|
||||
},
|
||||
success: function (data) {
|
||||
return process_table_data(data, 'mailcow_ui');
|
||||
}
|
||||
}),
|
||||
"empty": lang.empty,
|
||||
"paging": {"enabled": true,"limit": 5,"size": log_pagination_size},
|
||||
"filtering": {"enabled": true,"delay": 1,"position": "left","connectors": false,"placeholder": lang.filter_table},
|
||||
"sorting": {"enabled": true},
|
||||
"on": {
|
||||
"ready.ft.table": function(e, ft){
|
||||
table_log_ready(ft, 'ui_logs');
|
||||
},
|
||||
"after.ft.paging": function(e, ft){
|
||||
table_log_paging(ft, 'ui_logs');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function draw_acme_logs() {
|
||||
ft_acme_logs = FooTable.init('#acme_log', {
|
||||
"columns": [
|
||||
@@ -466,6 +502,12 @@ jQuery(function($){
|
||||
item.service = '';
|
||||
}
|
||||
});
|
||||
} else if (table == 'mailcow_ui') {
|
||||
$.each(data, function (i, item) {
|
||||
if (item === null) { return true; }
|
||||
item.user = escapeHtml(item.user);
|
||||
item.type = '<span class="label label-' + item.type + '">' + item.type + '</span>';
|
||||
});
|
||||
} else if (table == 'general_syslog') {
|
||||
$.each(data, function (i, item) {
|
||||
if (item === null) { return true; }
|
||||
@@ -496,7 +538,7 @@ jQuery(function($){
|
||||
$('.add_log_lines').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var log_table= $(this).data("table")
|
||||
var new_nrows = ($(this).data("nrows") - 1)
|
||||
var new_nrows = $(this).data("nrows")
|
||||
var post_process = $(this).data("post-process")
|
||||
var log_url = $(this).data("log-url")
|
||||
if (log_table === undefined || new_nrows === undefined || post_process === undefined || log_url === undefined) {
|
||||
@@ -506,7 +548,7 @@ jQuery(function($){
|
||||
if (ft = FooTable.get($('#' + log_table))) {
|
||||
var heading = ft.$el.parents('.tab-pane').find('.panel-heading')
|
||||
var ft_paging = ft.use(FooTable.Paging)
|
||||
var load_rows = ft_paging.totalRows + '-' + (ft_paging.totalRows + new_nrows)
|
||||
var load_rows = (ft_paging.totalRows + 1) + '-' + (ft_paging.totalRows + new_nrows)
|
||||
$.get('/api/v1/get/logs/' + log_url + '/' + load_rows).then(function(data){
|
||||
if (data.length === undefined) { mailcow_alert_box(lang.no_new_rows, "info"); return; }
|
||||
var rows = process_table_data(data, post_process);
|
||||
@@ -525,6 +567,7 @@ jQuery(function($){
|
||||
draw_watchdog_logs();
|
||||
draw_acme_logs();
|
||||
draw_api_logs();
|
||||
draw_ui_logs();
|
||||
draw_netfilter_logs();
|
||||
draw_rspamd_history();
|
||||
$(window).resize(function () {
|
||||
|
@@ -8,6 +8,16 @@ $(document).ready(function() {
|
||||
$("#textarea_alias_goto").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
$("#disable_sender_check").click(function( event ) {
|
||||
if ($("form[data-id='editmailbox'] #disable_sender_check:checked").length > 0) {
|
||||
$('#sender_acl').prop('disabled', true);
|
||||
$('#sender_acl').selectpicker('refresh');
|
||||
}
|
||||
else {
|
||||
$('#sender_acl').prop('disabled', false);
|
||||
$('#sender_acl').selectpicker('refresh');
|
||||
}
|
||||
});
|
||||
if ($("form[data-id='editalias'] .goto_checkbox:checked").length > 0) {
|
||||
$('#textarea_alias_goto').prop('disabled', true);
|
||||
}
|
||||
@@ -26,6 +36,17 @@ $("#multiple_bookings_select").change(function() {
|
||||
$("#multiple_bookings_custom_div").hide();
|
||||
}
|
||||
});
|
||||
if ($("#sender_acl option[value='\*']:selected").length > 0){
|
||||
$("#sender_acl_disabled").show();
|
||||
}
|
||||
$('#sender_acl').change(function() {
|
||||
if ($("#sender_acl option[value='\*']:selected").length > 0){
|
||||
$("#sender_acl_disabled").show();
|
||||
}
|
||||
else {
|
||||
$("#sender_acl_disabled").hide();
|
||||
}
|
||||
});
|
||||
$("#multiple_bookings_custom").bind("change keypress keyup blur", function() {
|
||||
$("#multiple_bookings").val($("#multiple_bookings_custom").val());
|
||||
});
|
||||
|
@@ -343,7 +343,7 @@ jQuery(function($){
|
||||
},
|
||||
{"name":"messages","filterable": false,"title":lang.msg_num,"breakpoints":"xs sm md"},
|
||||
{"name":"active","filterable": false,"title":lang.active},
|
||||
{"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
|
||||
{"name":"action","filterable": false,"sortable": false,"style":{"min-width":"250px","text-align":"right"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
|
||||
],
|
||||
"empty": lang.empty,
|
||||
"rows": $.ajax({
|
||||
|
@@ -41,6 +41,8 @@ jQuery(function($){
|
||||
return date.toLocaleString();
|
||||
}
|
||||
acl_data = JSON.parse(acl);
|
||||
var last_login = $('.last_login_date').data('time');
|
||||
$('.last_login_date').text(unix_time_format(last_login));
|
||||
|
||||
function draw_tla_table() {
|
||||
ft_tla_table = FooTable.init('#tla_table', {
|
||||
|
Reference in New Issue
Block a user