[BS5] datatables handle null values

This commit is contained in:
FreddleSpl0it 2022-07-01 16:20:39 +02:00
parent c505943e8b
commit 496c68d2af
6 changed files with 449 additions and 201 deletions

View File

@ -92,10 +92,12 @@ jQuery(function($){
{ {
title: lang.username, title: lang.username,
data: 'username', data: 'username',
defaultContent: ''
}, },
{ {
title: "TFA", title: "TFA",
data: 'tfa_active', data: 'tfa_active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
if(data == 1) return '<i class="bi bi-check-lg"></i>'; if(data == 1) return '<i class="bi bi-check-lg"></i>';
else return '<i class="bi bi-x-lg"></i>' else return '<i class="bi bi-x-lg"></i>'
@ -104,6 +106,7 @@ jQuery(function($){
{ {
title: lang.admin_domains, title: lang.admin_domains,
data: 'tfa_active', data: 'tfa_active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return data; return data;
} }
@ -111,6 +114,7 @@ jQuery(function($){
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
if(data == 1) return '<i class="bi bi-check-lg"></i>'; if(data == 1) return '<i class="bi bi-check-lg"></i>';
else return '<i class="bi bi-x-lg"></i>' else return '<i class="bi bi-x-lg"></i>'
@ -119,7 +123,8 @@ jQuery(function($){
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
], ],
initComplete: function(settings, json){ initComplete: function(settings, json){
@ -158,23 +163,28 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
defaultContent: ''
}, },
{ {
title: lang.oauth2_client_id, title: lang.oauth2_client_id,
data: 'client_id' data: 'client_id',
defaultContent: ''
}, },
{ {
title: lang.oauth2_client_secret, title: lang.oauth2_client_secret,
data: 'client_secret' data: 'client_secret',
defaultContent: ''
}, },
{ {
title: lang.oauth2_redirect_uri, title: lang.oauth2_redirect_uri,
data: 'redirect_uri' data: 'redirect_uri',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });
@ -210,10 +220,12 @@ jQuery(function($){
{ {
title: lang.username, title: lang.username,
data: 'username', data: 'username',
defaultContent: ''
}, },
{ {
title: "TFA", title: "TFA",
data: 'tfa_active', data: 'tfa_active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
if(data == 1) return '<i class="bi bi-check-lg"></i>'; if(data == 1) return '<i class="bi bi-check-lg"></i>';
else return '<i class="bi bi-x-lg"></i>' else return '<i class="bi bi-x-lg"></i>'
@ -222,6 +234,7 @@ jQuery(function($){
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
if(data == 1) return '<i class="bi bi-check-lg"></i>'; if(data == 1) return '<i class="bi bi-check-lg"></i>';
else return '<i class="bi bi-x-lg"></i>' else return '<i class="bi bi-x-lg"></i>'
@ -230,6 +243,7 @@ jQuery(function($){
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
defaultContent: '',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right'
}, },
] ]
@ -266,19 +280,23 @@ jQuery(function($){
{ {
title: lang.host, title: lang.host,
data: 'host', data: 'host',
defaultContent: ''
}, },
{ {
title: lang.source, title: lang.source,
data: 'source' data: 'source',
defaultContent: ''
}, },
{ {
title: lang.spamfilter, title: lang.spamfilter,
data: 'keep_spam' data: 'keep_spam',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });
@ -314,27 +332,33 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
defaultContent: ''
}, },
{ {
title: lang.host, title: lang.host,
data: 'hostname' data: 'hostname',
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
data: 'username' data: 'username',
defaultContent: ''
}, },
{ {
title: lang.in_use_by, title: lang.in_use_by,
data: 'in_use_by' data: 'in_use_by',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active' data: 'active',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });
@ -370,27 +394,33 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
defaultContent: ''
}, },
{ {
title: lang.destination, title: lang.destination,
data: 'destination' data: 'destination',
defaultContent: ''
}, },
{ {
title: lang.nexthop, title: lang.nexthop,
data: 'nexthop' data: 'nexthop',
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
data: 'username' data: 'username',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active' data: 'active',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });
@ -426,14 +456,17 @@ jQuery(function($){
{ {
title: 'QID', title: 'QID',
data: 'queue_id', data: 'queue_id',
defaultContent: ''
}, },
{ {
title: 'Queue', title: 'Queue',
data: 'queue_name' data: 'queue_name',
defaultContent: ''
}, },
{ {
title: lang.arrival_time, title: lang.arrival_time,
data: 'arrival_time', data: 'arrival_time',
defaultContent: '',
render: function (data, type){ render: function (data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -442,22 +475,26 @@ jQuery(function($){
{ {
title: lang.message_size, title: lang.message_size,
data: 'message_size', data: 'message_size',
defaultContent: '',
render: function (data, type){ render: function (data, type){
return humanFileSize(data); return humanFileSize(data);
} }
}, },
{ {
title: lang.sender, title: lang.sender,
data: 'sender' data: 'sender',
defaultContent: ''
}, },
{ {
title: lang.recipients, title: lang.recipients,
data: 'recipients' data: 'recipients',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });
@ -549,8 +586,10 @@ jQuery(function($){
// detect element visibility changes // detect element visibility changes
function onVisible(element, callback) { function onVisible(element, callback) {
$(element).ready(function() { $(document).ready(function() {
element_object = document.querySelector(element) element_object = document.querySelector(element);
if (element_object === null) return;
new IntersectionObserver((entries, observer) => { new IntersectionObserver((entries, observer) => {
entries.forEach(entry => { entries.forEach(entry => {
if(entry.intersectionRatio > 0) { if(entry.intersectionRatio > 0) {

View File

@ -71,6 +71,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -78,19 +79,23 @@ jQuery(function($){
}, },
{ {
title: 'User-Agent', title: 'User-Agent',
data: 'ua' data: 'ua',
defaultContent: ''
}, },
{ {
title: 'Username', title: 'Username',
data: 'user' data: 'user',
defaultContent: ''
}, },
{ {
title: 'IP', title: 'IP',
data: 'ip' data: 'ip',
defaultContent: ''
}, },
{ {
title: 'Service', title: 'Service',
data: 'service' data: 'service',
defaultContent: ''
} }
] ]
}); });
@ -112,6 +117,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -119,11 +125,13 @@ jQuery(function($){
}, },
{ {
title: lang.priority, title: lang.priority,
data: 'priority' data: 'priority',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -145,6 +153,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -152,15 +161,18 @@ jQuery(function($){
}, },
{ {
title: 'Service', title: 'Service',
data: 'service' data: 'service',
defaultContent: ''
}, },
{ {
title: 'Trend', title: 'Trend',
data: 'trend' data: 'trend',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -182,6 +194,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -189,19 +202,23 @@ jQuery(function($){
}, },
{ {
title: 'URI', title: 'URI',
data: 'uri' data: 'uri',
defaultContent: ''
}, },
{ {
title: 'Method', title: 'Method',
data: 'method' data: 'method',
defaultContent: ''
}, },
{ {
title: 'IP', title: 'IP',
data: 'remote' data: 'remote',
defaultContent: ''
}, },
{ {
title: 'Data', title: 'Data',
data: 'data' data: 'data',
defaultContent: ''
} }
] ]
}); });
@ -222,11 +239,13 @@ jQuery(function($){
columns: [ columns: [
{ {
title: ' ', title: ' ',
data: 'indicator' data: 'indicator',
defaultContent: ''
}, },
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -234,47 +253,58 @@ jQuery(function($){
}, },
{ {
title: lang.rate_name, title: lang.rate_name,
data: 'rl_name' data: 'rl_name',
defaultContent: ''
}, },
{ {
title: lang.sender, title: lang.sender,
data: 'from' data: 'from',
defaultContent: ''
}, },
{ {
title: lang.recipients, title: lang.recipients,
data: 'rcpt' data: 'rcpt',
defaultContent: ''
}, },
{ {
title: lang.authed_user, title: lang.authed_user,
data: 'user' data: 'user',
defaultContent: ''
}, },
{ {
title: 'Msg ID', title: 'Msg ID',
data: 'message_id' data: 'message_id',
defaultContent: ''
}, },
{ {
title: 'Header From', title: 'Header From',
data: 'header_from' data: 'header_from',
defaultContent: ''
}, },
{ {
title: 'Subject', title: 'Subject',
data: 'header_subject' data: 'header_subject',
defaultContent: ''
}, },
{ {
title: 'Hash', title: 'Hash',
data: 'rl_hash' data: 'rl_hash',
defaultContent: ''
}, },
{ {
title: 'Rspamd QID', title: 'Rspamd QID',
data: 'qid' data: 'qid',
defaultContent: ''
}, },
{ {
title: 'IP', title: 'IP',
data: 'ip' data: 'ip',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action' data: 'action',
defaultContent: ''
} }
] ]
}); });
@ -296,6 +326,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -303,31 +334,38 @@ jQuery(function($){
}, },
{ {
title: 'Type', title: 'Type',
data: 'type' data: 'type',
defaultContent: ''
}, },
{ {
title: 'Task', title: 'Task',
data: 'task' data: 'task',
defaultContent: ''
}, },
{ {
title: 'User', title: 'User',
data: 'user' data: 'user',
defaultContent: ''
}, },
{ {
title: 'Role', title: 'Role',
data: 'role' data: 'role',
defaultContent: ''
}, },
{ {
title: 'IP', title: 'IP',
data: 'remote' data: 'remote',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'msg' data: 'msg',
defaultContent: ''
}, },
{ {
title: 'Call', title: 'Call',
data: 'call' data: 'call',
defaultContent: ''
} }
] ]
}); });
@ -348,19 +386,23 @@ jQuery(function($){
columns: [ columns: [
{ {
title: lang.username, title: lang.username,
data: 'username' data: 'username',
defaultContent: ''
}, },
{ {
title: lang.service, title: lang.service,
data: 'service' data: 'service',
defaultContent: ''
}, },
{ {
title: 'IP', title: 'IP',
data: 'real_rip' data: 'real_rip',
defaultContent: ''
}, },
{ {
title: lang.login_time, title: lang.login_time,
data: 'datetime', data: 'datetime',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data.replace(/-/g, "/")); var date = new Date(data.replace(/-/g, "/"));
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -386,6 +428,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -393,7 +436,8 @@ jQuery(function($){
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -415,6 +459,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -422,11 +467,13 @@ jQuery(function($){
}, },
{ {
title: lang.priority, title: lang.priority,
data: 'priority' data: 'priority',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -448,6 +495,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -455,11 +503,13 @@ jQuery(function($){
}, },
{ {
title: lang.priority, title: lang.priority,
data: 'priority' data: 'priority',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -481,6 +531,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -488,11 +539,13 @@ jQuery(function($){
}, },
{ {
title: lang.priority, title: lang.priority,
data: 'priority' data: 'priority',
defaultContent: ''
}, },
{ {
title: lang.message, title: lang.message,
data: 'message' data: 'message',
defaultContent: ''
} }
] ]
}); });
@ -574,6 +627,7 @@ jQuery(function($){
{ {
title: lang.time, title: lang.time,
data: 'time', data: 'time',
defaultContent: '',
render: function(data, type){ render: function(data, type){
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -581,51 +635,63 @@ jQuery(function($){
}, },
{ {
title: 'IP address', title: 'IP address',
data: 'ip' data: 'ip',
defaultContent: ''
}, },
{ {
title: 'From', title: 'From',
data: 'sender_mime' data: 'sender_mime',
defaultContent: ''
}, },
{ {
title: 'To', title: 'To',
data: 'rcpt' data: 'rcpt',
defaultContent: ''
}, },
{ {
title: 'Subject', title: 'Subject',
data: 'subject' data: 'subject',
defaultContent: ''
}, },
{ {
title: 'Action', title: 'Action',
data: 'action' data: 'action',
defaultContent: ''
}, },
{ {
title: 'Score', title: 'Score',
data: 'score' data: 'score',
defaultContent: ''
}, },
{ {
title: 'Subject', title: 'Subject',
data: 'header_subject' data: 'header_subject',
defaultContent: ''
}, },
{ {
title: 'Symbols', title: 'Symbols',
data: 'symbols' data: 'symbols',
defaultContent: ''
}, },
{ {
title: 'Msg size', title: 'Msg size',
data: 'size' data: 'size',
defaultContent: ''
}, },
{ {
title: 'Scan Time', title: 'Scan Time',
data: 'scan_time' data: 'scan_time',
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
data: 'message-id' data: 'message-id',
defaultContent: ''
}, },
{ {
title: 'Authenticated user', title: 'Authenticated user',
data: 'user' data: 'user',
defaultContent: ''
} }
] ]
}); });
@ -832,8 +898,10 @@ jQuery(function($){
// detect element visibility changes // detect element visibility changes
function onVisible(element, callback) { function onVisible(element, callback) {
$(element).ready(function() { $(document).ready(function() {
element_object = document.querySelector(element) element_object = document.querySelector(element);
if (element_object === null) return;
new IntersectionObserver((entries, observer) => { new IntersectionObserver((entries, observer) => {
entries.forEach(entry => { entries.forEach(entry => {
if(entry.intersectionRatio > 0) { if(entry.intersectionRatio > 0) {

View File

@ -105,14 +105,17 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'prefid', data: 'prefid',
defaultContent: ''
}, },
{ {
title: lang_user.spamfilter_table_rule, title: lang_user.spamfilter_table_rule,
data: 'value' data: 'value',
defaultContent: ''
}, },
{ {
title: 'Scope', title: 'Scope',
data: 'object' data: 'object',
defaultContent: ''
} }
] ]
}); });
@ -157,14 +160,17 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'prefid', data: 'prefid',
defaultContent: ''
}, },
{ {
title: lang_user.spamfilter_table_rule, title: lang_user.spamfilter_table_rule,
data: 'value' data: 'value',
defaultContent: ''
}, },
{ {
title: 'Scope', title: 'Scope',
data: 'object' data: 'object',
defaultContent: ''
} }
] ]
}); });
@ -173,8 +179,10 @@ jQuery(function($){
// detect element visibility changes // detect element visibility changes
function onVisible(element, callback) { function onVisible(element, callback) {
$(element).ready(function() { $(document).ready(function() {
element_object = document.querySelector(element) element_object = document.querySelector(element);
if (element_object === null) return;
new IntersectionObserver((entries, observer) => { new IntersectionObserver((entries, observer) => {
entries.forEach(entry => { entries.forEach(entry => {
if(entry.intersectionRatio > 0) { if(entry.intersectionRatio > 0) {

View File

@ -277,20 +277,24 @@ jQuery(function($){
{ {
title: lang.domain, title: lang.domain,
data: 'domain_name', data: 'domain_name',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.aliases, title: lang.aliases,
data: 'aliases_in_domain' data: 'aliases_in_domain',
defaultContent: ''
}, },
{ {
title: lang.mailboxes, title: lang.mailboxes,
data: 'mboxes_in_domain', data: 'mboxes_in_domain',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.domain_quota, title: lang.domain_quota,
data: 'quota', data: 'quota',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
data = data.split("/"); data = data.split("/");
return humanFileSize(data[0]) + " / " + humanFileSize(data[1]); return humanFileSize(data[0]) + " / " + humanFileSize(data[1]);
@ -299,6 +303,7 @@ jQuery(function($){
{ {
title: lang.stats, title: lang.stats,
data: 'stats', data: 'stats',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
data = data.split("/"); data = data.split("/");
return '<i class="bi bi-files"></i> ' + data[0] + ' / ' + humanFileSize(data[1]); return '<i class="bi bi-files"></i> ' + data[0] + ' / ' + humanFileSize(data[1]);
@ -306,34 +311,41 @@ jQuery(function($){
}, },
{ {
title: lang.mailbox_defquota, title: lang.mailbox_defquota,
data: 'def_quota_for_mbox' data: 'def_quota_for_mbox',
defaultContent: ''
}, },
{ {
title: lang.mailbox_quota, title: lang.mailbox_quota,
data: 'max_quota_for_mbox' data: 'max_quota_for_mbox',
defaultContent: ''
}, },
{ {
title: 'RL', title: 'RL',
data: 'rl' data: 'rl',
defaultContent: ''
}, },
{ {
title: lang.backup_mx, title: lang.backup_mx,
data: 'backupmx', data: 'backupmx',
defaultContent: '',
redner: function (data, type){ redner: function (data, type){
return 1==value ? '<i class="bi bi-check-lg"></i>' : 0==value && '<i class="bi bi-x-lg"></i>'; return 1==value ? '<i class="bi bi-check-lg"></i>' : 0==value && '<i class="bi bi-x-lg"></i>';
} }
}, },
{ {
title: lang.domain_admins, title: lang.domain_admins,
data: 'domain_admins' data: 'domain_admins',
defaultContent: ''
}, },
{ {
title: 'Tags', title: 'Tags',
data: 'tags' data: 'tags',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;'); return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;');
} }
@ -342,7 +354,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -459,20 +472,24 @@ jQuery(function($){
{ {
title: lang.username, title: lang.username,
data: 'username', data: 'username',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.fname, title: lang.fname,
data: 'name' data: 'name',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain' data: 'domain',
defaultContent: ''
}, },
{ {
title: lang.domain_quota, title: lang.domain_quota,
data: 'quota', data: 'quota',
responsivePriority: 4, responsivePriority: 4,
defaultContent: '',
render: function (data, type) { render: function (data, type) {
data = data.split("/"); data = data.split("/");
var of_q = (data[1] == 0 ? "∞" : humanFileSize(data[1])); var of_q = (data[1] == 0 ? "∞" : humanFileSize(data[1]));
@ -481,55 +498,68 @@ jQuery(function($){
}, },
{ {
title: lang.tls_enforce_in, title: lang.tls_enforce_in,
data: 'tls_enforce_in' data: 'tls_enforce_in',
defaultContent: ''
}, },
{ {
title: lang.tls_enforce_out, title: lang.tls_enforce_out,
data: 'tls_enforce_out' data: 'tls_enforce_out',
defaultContent: ''
}, },
{ {
title: 'SMTP', title: 'SMTP',
data: 'smtp_access' data: 'smtp_access',
defaultContent: ''
}, },
{ {
title: 'IMAP', title: 'IMAP',
data: 'imap_access' data: 'imap_access',
defaultContent: ''
}, },
{ {
title: 'POP3', title: 'POP3',
data: 'pop3_access' data: 'pop3_access',
defaultContent: ''
}, },
{ {
title: lang.last_mail_login, title: lang.last_mail_login,
data: 'last_mail_login' data: 'last_mail_login',
defaultContent: ''
}, },
{ {
title: lang.last_pw_change, title: lang.last_pw_change,
data: 'last_pw_change' data: 'last_pw_change',
defaultContent: ''
}, },
{ {
title: lang.quarantine_notification, title: lang.quarantine_notification,
data: 'quarantine_notification' data: 'quarantine_notification',
defaultContent: ''
}, },
{ {
title: lang.quarantine_category, title: lang.quarantine_category,
data: 'quarantine_category' data: 'quarantine_category',
defaultContent: ''
}, },
{ {
title: lang.in_use, title: lang.in_use,
data: 'in_use' data: 'in_use',
defaultContent: ''
}, },
{ {
title: lang.msg_num, title: lang.msg_num,
data: 'messages' data: 'messages',
defaultContent: ''
}, },
{ {
title: 'Tags', title: 'Tags',
data: 'tags' data: 'tags',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;'); return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;');
} }
@ -538,7 +568,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -593,28 +624,34 @@ jQuery(function($){
{ {
title: lang.description, title: lang.description,
data: 'description', data: 'description',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.alias, title: lang.alias,
data: 'name' data: 'name',
defaultContent: ''
}, },
{ {
title: lang.kind, title: lang.kind,
data: 'kind' data: 'kind',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain', data: 'domain',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.multiple_bookings, title: lang.multiple_bookings,
data: 'multiple_bookings' data: 'multiple_bookings',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;'); return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;');
} }
@ -623,7 +660,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -676,28 +714,34 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.bcc_type, title: lang.bcc_type,
data: 'type' data: 'type',
defaultContent: ''
}, },
{ {
title: lang.bcc_local_dest, title: lang.bcc_local_dest,
data: 'local_dest' data: 'local_dest',
defaultContent: ''
}, },
{ {
title: lang.bcc_destinations, title: lang.bcc_destinations,
data: 'bcc_dest' data: 'bcc_dest',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain', data: 'domain',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;'); return 1==data?'<i class="bi bi-check-lg"></i>':(0==data?'<i class="bi bi-x-lg"></i>':2==data&&'&#8212;');
} }
@ -706,7 +750,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -756,19 +801,23 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.recipient_map_old, title: lang.recipient_map_old,
data: 'recipient_map_old' data: 'recipient_map_old',
defaultContent: ''
}, },
{ {
title: lang.recipient_map_new, title: lang.recipient_map_new,
data: 'recipient_map_new' data: 'recipient_map_new',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
} }
@ -777,7 +826,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
] ]
}); });
@ -832,28 +882,34 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.tls_map_dest, title: lang.tls_map_dest,
data: 'dest' data: 'dest',
defaultContent: ''
}, },
{ {
title: lang.tls_map_policy, title: lang.tls_map_policy,
data: 'policy' data: 'policy',
defaultContent: ''
}, },
{ {
title: lang.tls_map_parameters, title: lang.tls_map_parameters,
data: 'parameters' data: 'parameters',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain', data: 'domain',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
} }
@ -862,7 +918,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -939,40 +996,49 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.alias, title: lang.alias,
data: 'address', data: 'address',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.target_address, title: lang.target_address,
data: 'goto' data: 'goto',
defaultContent: ''
}, },
{ {
title: lang.bcc_destinations, title: lang.bcc_destinations,
data: 'bcc_dest' data: 'bcc_dest',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain' data: 'domain',
defaultContent: ''
}, },
{ {
title: lang.public_comment, title: lang.public_comment,
data: 'public_comment' data: 'public_comment',
defaultContent: ''
}, },
{ {
title: lang.private_comment, title: lang.private_comment,
data: 'private_comment' data: 'private_comment',
defaultContent: ''
}, },
{ {
title: lang.sogo_visible, title: lang.sogo_visible,
data: 'sogo_visible' data: 'sogo_visible',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
} }
@ -981,7 +1047,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -1033,28 +1100,34 @@ jQuery(function($){
{ {
title: lang.alias, title: lang.alias,
data: 'alias_domain', data: 'alias_domain',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.target_domain, title: lang.target_domain,
data: 'target_domain', data: 'target_domain',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.bcc_local_dest, title: lang.bcc_local_dest,
data: 'local_dest' data: 'local_dest',
defaultContent: ''
}, },
{ {
title: lang.bcc_destinations, title: lang.bcc_destinations,
data: 'bcc_dest' data: 'bcc_dest',
defaultContent: ''
}, },
{ {
title: lang.domain, title: lang.domain,
data: 'domain' data: 'domain',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
} }
@ -1063,7 +1136,8 @@ jQuery(function($){
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -1137,53 +1211,64 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.owner, title: lang.owner,
data: 'user2', data: 'user2',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: 'Server', title: 'Server',
data: 'server_w_port' data: 'server_w_port',
defaultContent: ''
}, },
{ {
title: lang.excludes, title: lang.excludes,
data: 'exclude' data: 'exclude',
defaultContent: ''
}, },
{ {
title: lang.mins_interval, title: lang.mins_interval,
data: 'mins_interval' data: 'mins_interval',
defaultContent: ''
}, },
{ {
title: lang.last_run, title: lang.last_run,
data: 'last_run' data: 'last_run',
defaultContent: ''
}, },
{ {
title: lang.syncjob_last_run_result, title: lang.syncjob_last_run_result,
data: 'exit_status' data: 'exit_status',
defaultContent: ''
}, },
{ {
title: lang.status, title: lang.status,
data: 'is_running' data: 'is_running',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
} }
}, },
{ {
title: 'Log', title: 'Log',
data: 'log' data: 'log',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -1236,34 +1321,41 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
responsivePriority: 3 responsivePriority: 3,
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active' data: 'active',
defaultContent: ''
}, },
{ {
title: 'Type', title: 'Type',
data: 'filter_type', data: 'filter_type',
responsivePriority: 4 responsivePriority: 4,
defaultContent: ''
}, },
{ {
title: lang.owner, title: lang.owner,
data: 'username' data: 'username',
defaultContent: ''
}, },
{ {
title: lang.description, title: lang.description,
data: 'script_desc' data: 'script_desc',
defaultContent: ''
}, },
{ {
title: 'Script', title: 'Script',
data: 'script_data' data: 'script_data',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right', className: 'text-md-end dt-sm-head-hidden dt-body-right',
responsivePriority: 5 responsivePriority: 5,
defaultContent: ''
}, },
] ]
}); });
@ -1271,8 +1363,10 @@ jQuery(function($){
// detect element visibility changes // detect element visibility changes
function onVisible(element, callback) { function onVisible(element, callback) {
$(element).ready(function() { $(document).ready(function() {
element_object = document.querySelector(element) element_object = document.querySelector(element);
if (element_object === null) return;
new IntersectionObserver((entries, observer) => { new IntersectionObserver((entries, observer) => {
entries.forEach(entry => { entries.forEach(entry => {
if(entry.intersectionRatio > 0) { if(entry.intersectionRatio > 0) {

View File

@ -83,42 +83,52 @@ jQuery(function($){
{ {
title: 'ID', title: 'ID',
data: 'id', data: 'id',
defaultContent: ''
}, },
{ {
title: lang.qid, title: lang.qid,
data: 'qid' data: 'qid',
defaultContent: ''
}, },
{ {
title: lang.sender, title: lang.sender,
data: 'sender' data: 'sender',
defaultContent: ''
}, },
{ {
title: lang.subj, title: lang.subj,
data: 'sender' data: 'sender',
defaultContent: ''
}, },
{ {
title: lang.rspamd_result, title: lang.rspamd_result,
data: 'rspamdaction' data: 'rspamdaction',
defaultContent: ''
}, },
{ {
title: lang.rcpt, title: lang.rcpt,
data: 'rcpt' data: 'rcpt',
defaultContent: ''
}, },
{ {
title: lang.danger, title: lang.danger,
data: 'virus' data: 'virus',
defaultContent: ''
}, },
{ {
title: lang.spam_score, title: lang.spam_score,
data: 'score' data: 'score',
defaultContent: ''
}, },
{ {
title: lang.notified, title: lang.notified,
data: 'notified' data: 'notified',
defaultContent: ''
}, },
{ {
title: lang.received, title: lang.received,
data: 'created', data: 'created',
defaultContent: '',
render: function (data,type) { render: function (data,type) {
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -127,7 +137,8 @@ jQuery(function($){
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
}, },
] ]
}); });

View File

@ -172,11 +172,13 @@ jQuery(function($){
}, },
{ {
title: lang.alias, title: lang.alias,
data: 'address' data: 'address',
defaultContent: ''
}, },
{ {
title: lang.alias_valid_until, title: lang.alias_valid_until,
data: 'validity', data: 'validity',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
var date = new Date(data ? data * 1000 : 0); var date = new Date(data ? data * 1000 : 0);
return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});
@ -185,7 +187,8 @@ jQuery(function($){
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
} }
] ]
}); });
@ -263,55 +266,67 @@ jQuery(function($){
}, },
{ {
title: 'ID', title: 'ID',
data: 'id' data: 'id',
defaultContent: ''
}, },
{ {
title: 'Server', title: 'Server',
data: 'server_w_port' data: 'server_w_port',
defaultContent: ''
}, },
{ {
title: lang.encryption, title: lang.encryption,
data: 'enc1' data: 'enc1',
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
data: 'user1' data: 'user1',
defaultContent: ''
}, },
{ {
title: lang.excludes, title: lang.excludes,
data: 'exclude' data: 'exclude',
defaultContent: ''
}, },
{ {
title: lang.interval + " (min)", title: lang.interval + " (min)",
data: 'mins_interval' data: 'mins_interval',
defaultContent: ''
}, },
{ {
title: lang.last_run, title: lang.last_run,
data: 'last_run' data: 'last_run',
defaultContent: ''
}, },
{ {
title: lang.syncjob_last_run_result, title: lang.syncjob_last_run_result,
data: 'exit_status' data: 'exit_status',
defaultContent: ''
}, },
{ {
title: 'Log', title: 'Log',
data: 'log' data: 'log',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>' return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'
} }
}, },
{ {
title: lang.status, title: lang.status,
data: 'is_running' data: 'is_running',
defaultContent: ''
}, },
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
} }
] ]
}); });
@ -370,19 +385,23 @@ jQuery(function($){
}, },
{ {
title: 'ID', title: 'ID',
data: 'id' data: 'id',
defaultContent: ''
}, },
{ {
title: lang.app_name, title: lang.app_name,
data: 'name' data: 'name',
defaultContent: ''
}, },
{ {
title: lang.allowed_protocols, title: lang.allowed_protocols,
data: 'protocols' data: 'protocols',
defaultContent: ''
}, },
{ {
title: lang.active, title: lang.active,
data: 'active', data: 'active',
defaultContent: '',
render: function (data, type) { render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>' return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'
} }
@ -390,7 +409,8 @@ jQuery(function($){
{ {
title: lang.action, title: lang.action,
data: 'action', data: 'action',
className: 'text-md-end dt-sm-head-hidden dt-body-right' className: 'text-md-end dt-sm-head-hidden dt-body-right',
defaultContent: ''
} }
] ]
}); });
@ -438,15 +458,18 @@ jQuery(function($){
}, },
{ {
title: 'ID', title: 'ID',
data: 'prefid' data: 'prefid',
defaultContent: ''
}, },
{ {
title: lang.spamfilter_table_rule, title: lang.spamfilter_table_rule,
data: 'name' data: 'name',
defaultContent: ''
}, },
{ {
title:'Scope', title:'Scope',
data: 'object' data: 'object',
defaultContent: ''
} }
] ]
}); });
@ -494,15 +517,18 @@ jQuery(function($){
}, },
{ {
title: 'ID', title: 'ID',
data: 'prefid' data: 'prefid',
defaultContent: ''
}, },
{ {
title: lang.spamfilter_table_rule, title: lang.spamfilter_table_rule,
data: 'name' data: 'name',
defaultContent: ''
}, },
{ {
title:'Scope', title:'Scope',
data: 'object' data: 'object',
defaultContent: ''
} }
] ]
}); });
@ -542,8 +568,10 @@ jQuery(function($){
// detect element visibility changes // detect element visibility changes
function onVisible(element, callback) { function onVisible(element, callback) {
$(element).ready(function() { $(document).ready(function() {
element_object = document.querySelector(element) element_object = document.querySelector(element);
if (element_object === null) return;
new IntersectionObserver((entries, observer) => { new IntersectionObserver((entries, observer) => {
entries.forEach(entry => { entries.forEach(entry => {
if(entry.intersectionRatio > 0) { if(entry.intersectionRatio > 0) {