1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-04 10:24:42 +02:00

[BS5] jquery datatables disable orderable checkboxes

This commit is contained in:
FreddleSpl0it 2022-06-08 12:03:54 +02:00
parent 351c803623
commit 09ae37410e
5 changed files with 166 additions and 90 deletions

View File

@ -86,7 +86,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
@ -145,7 +148,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -193,7 +199,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
@ -245,7 +254,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.host, title: lang.host,
@ -289,7 +301,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -341,7 +356,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -393,7 +411,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'QID', title: 'QID',

View File

@ -97,7 +97,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -146,7 +149,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',

View File

@ -240,7 +240,6 @@ jQuery(function($){
type: "GET", type: "GET",
url: "/api/v1/get/domain/all", url: "/api/v1/get/domain/all",
dataSrc: function(json){ dataSrc: function(json){
console.log(json);
$.each(json, function(i, item) { $.each(json, function(i, item) {
item.aliases = item.aliases_in_domain + " / " + item.max_num_aliases_for_domain; item.aliases = item.aliases_in_domain + " / " + item.max_num_aliases_for_domain;
item.mailboxes = item.mboxes_in_domain + " / " + item.max_num_mboxes_for_domain; item.mailboxes = item.mboxes_in_domain + " / " + item.max_num_mboxes_for_domain;
@ -279,66 +278,80 @@ jQuery(function($){
} }
}); });
console.log(json);
return json; return json;
} }
}, },
columns: [ columns: [
{ {
title: lang.domain, // placeholder, so checkbox will not block child row toggle
data: 'domain_name' title: '',
}, data: null,
{ searchable: false,
title: lang.aliases, orderable: false,
data: 'aliases_in_domain' defaultContent: ''
}, },
{ {
title: lang.mailboxes, title: '',
data: 'mboxes_in_domain' data: 'chkbox',
}, searchable: false,
{ orderable: false,
title: lang.domain_quota, defaultContent: ''
data: 'quota', },
render: function (data, type) { {
data = data.split("/"); title: lang.domain,
return humanFileSize(data[0]) + " / " + humanFileSize(data[1]); data: 'domain_name'
} },
}, {
{ title: lang.aliases,
title: lang.stats, data: 'aliases_in_domain'
data: 'stats', },
render: function (data, type) { {
data = data.split("/"); title: lang.mailboxes,
return '<i class="bi bi-files"></i> ' + data[0] + ' / ' + humanFileSize(data[1]); data: 'mboxes_in_domain'
} },
}, {
{ title: lang.domain_quota,
title: lang.mailbox_defquota, data: 'quota',
data: 'def_quota_for_mbox' render: function (data, type) {
}, data = data.split("/");
{ return humanFileSize(data[0]) + " / " + humanFileSize(data[1]);
title: lang.mailbox_quota, }
data: 'max_quota_for_mbox' },
}, {
{ title: lang.stats,
title: 'RL', data: 'stats',
data: 'rl' render: function (data, type) {
}, data = data.split("/");
{ return '<i class="bi bi-files"></i> ' + data[0] + ' / ' + humanFileSize(data[1]);
title: lang.backup_mx, }
data: 'backupmx', },
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.mailbox_defquota,
} data: 'def_quota_for_mbox'
}, },
{ {
title: lang.domain_admins, title: lang.mailbox_quota,
data: 'domain_admins' data: 'max_quota_for_mbox'
}, },
{ {
title: lang.action, title: 'RL',
data: 'action' data: 'rl'
}, },
{
title: lang.backup_mx,
data: 'backupmx',
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'
},
{
title: lang.action,
data: 'action'
},
] ]
}); });
} }
@ -421,7 +434,6 @@ jQuery(function($){
item.username = escapeHtml(item.username); item.username = escapeHtml(item.username);
}); });
console.log(json);
return json; return json;
} }
}, },
@ -436,7 +448,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.username, title: lang.username,
@ -542,7 +557,6 @@ jQuery(function($){
item.name = escapeHtml(item.name); item.name = escapeHtml(item.name);
}); });
console.log(json);
return json; return json;
} }
}, },
@ -557,7 +571,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.description, title: lang.description,
@ -617,7 +634,6 @@ jQuery(function($){
} }
}); });
console.log(json);
return json; return json;
} }
}, },
@ -632,7 +648,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -689,7 +708,6 @@ jQuery(function($){
item.chkbox = '<input type="checkbox" data-id="recipient_map" name="multi_select" value="' + item.id + '" />'; item.chkbox = '<input type="checkbox" data-id="recipient_map" name="multi_select" value="' + item.id + '" />';
}); });
console.log(json);
return json; return json;
} }
}, },
@ -704,7 +722,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -758,7 +779,6 @@ jQuery(function($){
item.chkbox = '<input type="checkbox" data-id="tls-policy-map" name="multi_select" value="' + item.id + '" />'; item.chkbox = '<input type="checkbox" data-id="tls-policy-map" name="multi_select" value="' + item.id + '" />';
}); });
console.log(json);
return json; return json;
} }
}, },
@ -773,7 +793,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -857,7 +880,6 @@ jQuery(function($){
} }
}); });
console.log(json);
return json; return json;
} }
}, },
@ -872,7 +894,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -943,7 +968,6 @@ jQuery(function($){
} }
}); });
console.log(json);
return json; return json;
} }
}, },
@ -958,7 +982,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.alias, title: lang.alias,
@ -1039,7 +1066,6 @@ jQuery(function($){
item.exit_status = item.success + ' ' + item.exit_status; item.exit_status = item.success + ' ' + item.exit_status;
}); });
console.log(json);
return json; return json;
} }
}, },
@ -1054,7 +1080,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -1130,7 +1159,6 @@ jQuery(function($){
item.chkbox = '<input type="checkbox" data-id="filter_item" name="multi_select" value="' + item.id + '" />' item.chkbox = '<input type="checkbox" data-id="filter_item" name="multi_select" value="' + item.id + '" />'
}); });
console.log(json);
return json; return json;
} }
}, },
@ -1145,7 +1173,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',

View File

@ -75,7 +75,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',

View File

@ -165,7 +165,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: lang.alias, title: lang.alias,
@ -252,7 +255,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -355,7 +361,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -419,7 +428,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',
@ -472,7 +484,10 @@ jQuery(function($){
}, },
{ {
title: '', title: '',
data: 'chkbox' data: 'chkbox',
searchable: false,
orderable: false,
defaultContent: ''
}, },
{ {
title: 'ID', title: 'ID',