Browse Source

[BS5] datatables handle null values

FreddleSpl0it 3 years ago
parent
commit
496c68d2af

+ 63 - 24
data/web/js/site/admin.js

@@ -92,10 +92,12 @@ jQuery(function($){
           {
             title: lang.username,
             data: 'username',
+            defaultContent: ''
           },
           {
             title: "TFA",
             data: 'tfa_active',
+            defaultContent: '',
             render: function (data, type) {
               if(data == 1) return '<i class="bi bi-check-lg"></i>';
               else return '<i class="bi bi-x-lg"></i>'
@@ -104,6 +106,7 @@ jQuery(function($){
           {
             title: lang.admin_domains,
             data: 'tfa_active',
+            defaultContent: '',
             render: function (data, type) {
               return data;
             }
@@ -111,6 +114,7 @@ jQuery(function($){
           {
             title: lang.active,
             data: 'active',
+            defaultContent: '',
             render: function (data, type) {
               if(data == 1) return '<i class="bi bi-check-lg"></i>';
               else return '<i class="bi bi-x-lg"></i>'
@@ -119,7 +123,8 @@ jQuery(function($){
           {
             title: lang.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){
@@ -158,23 +163,28 @@ jQuery(function($){
           {
             title: 'ID',
             data: 'id',
+            defaultContent: ''
           },
           {
             title: lang.oauth2_client_id,
-            data: 'client_id'
+            data: 'client_id',
+            defaultContent: ''
           },
           {
             title: lang.oauth2_client_secret,
-            data: 'client_secret'
+            data: 'client_secret',
+            defaultContent: ''
           },
           {
             title: lang.oauth2_redirect_uri,
-            data: 'redirect_uri'
+            data: 'redirect_uri',
+            defaultContent: ''
           },
           {
             title: lang.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,
             data: 'username',
+            defaultContent: ''
           },
           {
             title: "TFA",
             data: 'tfa_active',
+            defaultContent: '',
             render: function (data, type) {
               if(data == 1) return '<i class="bi bi-check-lg"></i>';
               else return '<i class="bi bi-x-lg"></i>'
@@ -222,6 +234,7 @@ jQuery(function($){
           {
             title: lang.active,
             data: 'active',
+            defaultContent: '',
             render: function (data, type) {
               if(data == 1) return '<i class="bi bi-check-lg"></i>';
               else return '<i class="bi bi-x-lg"></i>'
@@ -230,6 +243,7 @@ jQuery(function($){
           {
             title: lang.action,
             data: 'action',
+            defaultContent: '',
             className: 'text-md-end dt-sm-head-hidden dt-body-right'
           },
       ]
@@ -266,19 +280,23 @@ jQuery(function($){
           {
             title: lang.host,
             data: 'host',
+            defaultContent: ''
           },
           {
             title: lang.source,
-            data: 'source'
+            data: 'source',
+            defaultContent: ''
           },
           {
             title: lang.spamfilter,
-            data: 'keep_spam'
+            data: 'keep_spam',
+            defaultContent: ''
           },
           {
             title: lang.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',
             data: 'id',
+            defaultContent: ''
           },
           {
             title: lang.host,
-            data: 'hostname'
+            data: 'hostname',
+            defaultContent: ''
           },
           {
             title: lang.username,
-            data: 'username'
+            data: 'username',
+            defaultContent: ''
           },
           {
             title: lang.in_use_by,
-            data: 'in_use_by'
+            data: 'in_use_by',
+            defaultContent: ''
           },
           {
             title: lang.active,
-            data: 'active'
+            data: 'active',
+            defaultContent: ''
           },
           {
             title: lang.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',
             data: 'id',
+            defaultContent: ''
           },
           {
             title: lang.destination,
-            data: 'destination'
+            data: 'destination',
+            defaultContent: ''
           },
           {
             title: lang.nexthop,
-            data: 'nexthop'
+            data: 'nexthop',
+            defaultContent: ''
           },
           {
             title: lang.username,
-            data: 'username'
+            data: 'username',
+            defaultContent: ''
           },
           {
             title: lang.active,
-            data: 'active'
+            data: 'active',
+            defaultContent: ''
           },
           {
             title: lang.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',
             data: 'queue_id',
+            defaultContent: ''
           },
           {
             title: 'Queue',
-            data: 'queue_name'
+            data: 'queue_name',
+            defaultContent: ''
           },
           {
             title: lang.arrival_time,
             data: 'arrival_time',
+            defaultContent: '',
             render: function (data, type){
               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"});
@@ -442,22 +475,26 @@ jQuery(function($){
           {
             title: lang.message_size,
             data: 'message_size',
+            defaultContent: '',
             render: function (data, type){
               return humanFileSize(data);
             }
           },
           {
             title: lang.sender,
-            data: 'sender'
+            data: 'sender',
+            defaultContent: ''
           },
           {
             title: lang.recipients,
-            data: 'recipients'
+            data: 'recipients',
+            defaultContent: ''
           },
           {
             title: lang.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
   function onVisible(element, callback) {
-    $(element).ready(function() {
-      element_object = document.querySelector(element)
+    $(document).ready(function() {
+      element_object = document.querySelector(element);
+      if (element_object === null) return;
+
       new IntersectionObserver((entries, observer) => {
         entries.forEach(entry => {
           if(entry.intersectionRatio > 0) {

+ 124 - 56
data/web/js/site/debug.js

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

+ 14 - 6
data/web/js/site/edit.js

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

+ 175 - 81
data/web/js/site/mailbox.js

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

+ 20 - 9
data/web/js/site/quarantine.js

@@ -83,42 +83,52 @@ jQuery(function($){
           {
             title: 'ID',
             data: 'id',
+            defaultContent: ''
           },
           {
             title: lang.qid,
-            data: 'qid'
+            data: 'qid',
+            defaultContent: ''
           },
           {
             title: lang.sender,
-            data: 'sender'
+            data: 'sender',
+            defaultContent: ''
           },
           {
             title: lang.subj,
-            data: 'sender'
+            data: 'sender',
+            defaultContent: ''
           },
           {
             title: lang.rspamd_result,
-            data: 'rspamdaction'
+            data: 'rspamdaction',
+            defaultContent: ''
           },
           {
             title: lang.rcpt,
-            data: 'rcpt'
+            data: 'rcpt',
+            defaultContent: ''
           },
           {
             title: lang.danger,
-            data: 'virus'
+            data: 'virus',
+            defaultContent: ''
           },
           {
             title: lang.spam_score,
-            data: 'score'
+            data: 'score',
+            defaultContent: ''
           },
           {
             title: lang.notified,
-            data: 'notified'
+            data: 'notified',
+            defaultContent: ''
           },
           {
             title: lang.received,
             data: 'created',
+            defaultContent: '',
             render: function (data,type) {
               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"});
@@ -127,7 +137,8 @@ jQuery(function($){
           {
             title: lang.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: ''
           },
       ]
     });

+ 53 - 25
data/web/js/site/user.js

@@ -172,11 +172,13 @@ jQuery(function($){
         },
         {
           title: lang.alias,
-          data: 'address'
+          data: 'address',
+          defaultContent: ''
         },
         {
           title: lang.alias_valid_until,
           data: 'validity',
+          defaultContent: '',
           render: function (data, type) {
             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"});
@@ -185,7 +187,8 @@ jQuery(function($){
         {
           title: lang.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',
-          data: 'id'
+          data: 'id',
+          defaultContent: ''
         },
         {
           title: 'Server',
-          data: 'server_w_port'
+          data: 'server_w_port',
+          defaultContent: ''
         },
         {
           title: lang.encryption,
-          data: 'enc1'
+          data: 'enc1',
+          defaultContent: ''
         },
         {
           title: lang.username,
-          data: 'user1'
+          data: 'user1',
+          defaultContent: ''
         },
         {
           title: lang.excludes,
-          data: 'exclude'
+          data: 'exclude',
+          defaultContent: ''
         },
         {
           title: lang.interval + " (min)",
-          data: 'mins_interval'
+          data: 'mins_interval',
+          defaultContent: ''
         },
         {
           title: lang.last_run,
-          data: 'last_run'
+          data: 'last_run',
+          defaultContent: ''
         },
         {
           title: lang.syncjob_last_run_result,
-          data: 'exit_status'
+          data: 'exit_status',
+          defaultContent: ''
         },
         {
           title: 'Log',
-          data: 'log'
+          data: 'log',
+          defaultContent: ''
         },
         {
           title: lang.active,
           data: 'active',
+          defaultContent: '',
           render: function (data, type) {
             return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'
           }
         },
         {
           title: lang.status,
-          data: 'is_running'
+          data: 'is_running',
+          defaultContent: ''
         },
         {
           title: lang.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',
-          data: 'id'
+          data: 'id',
+          defaultContent: ''
         },
         {
           title: lang.app_name,
-          data: 'name'
+          data: 'name',
+          defaultContent: ''
         },
         {
           title: lang.allowed_protocols,
-          data: 'protocols'
+          data: 'protocols',
+          defaultContent: ''
         },
         {
           title: lang.active,
           data: 'active',
+          defaultContent: '',
           render: function (data, type) {
             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,
           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',
-          data: 'prefid'
+          data: 'prefid',
+          defaultContent: ''
         },
         {
           title: lang.spamfilter_table_rule,
-          data: 'name'
+          data: 'name',
+          defaultContent: ''
         },
         {
           title:'Scope',
-          data: 'object'
+          data: 'object',
+          defaultContent: ''
         }
       ]
     });
@@ -494,15 +517,18 @@ jQuery(function($){
         },
         {
           title: 'ID',
-          data: 'prefid'
+          data: 'prefid',
+          defaultContent: ''
         },
         {
           title: lang.spamfilter_table_rule,
-          data: 'name'
+          data: 'name',
+          defaultContent: ''
         },
         {
           title:'Scope',
-          data: 'object'
+          data: 'object',
+          defaultContent: ''
         }
       ]
     });
@@ -542,8 +568,10 @@ jQuery(function($){
 
   // detect element visibility changes
   function onVisible(element, callback) {
-    $(element).ready(function() {
-      element_object = document.querySelector(element)
+    $(document).ready(function() {
+      element_object = document.querySelector(element);
+      if (element_object === null) return;
+
       new IntersectionObserver((entries, observer) => {
         entries.forEach(entry => {
           if(entry.intersectionRatio > 0) {