[Postfix, Web] Feature: BCC maps

This commit is contained in:
André
2017-11-19 15:13:43 +01:00
parent 967108c057
commit ade4b9e7ae
16 changed files with 748 additions and 22 deletions

View File

@@ -314,7 +314,56 @@ jQuery(function($){
}
});
}
function draw_bcc_table() {
ft_bcc_table = FooTable.init('#bcc_table', {
"columns": [
{"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"},
{"sorted": true,"name":"id","title":"ID","style":{"maxWidth":"60px","width":"60px","text-align":"center"}},
{"name":"type","title":"Type"},
{"name":"local_dest","title":"Local destination"},
{"name":"bcc_dest","title":"BCC destination/s"},
{"name":"domain","title":lang.domain,"breakpoints":"xs sm"},
{"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active},
{"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"}
],
"empty": lang.empty,
"rows": $.ajax({
dataType: 'json',
url: '/api/v1/get/bcc/all',
jsonp: false,
error: function () {
console.log('Cannot draw bcc table');
},
success: function (data) {
$.each(data, function (i, item) {
item.action = '<div class="btn-group">' +
'<a href="/edit.php?bcc=' + item.id + '" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-pencil"></span> ' + lang.edit + '</a>' +
'<a href="#" id="delete_selected" data-id="single-bcc" data-api-url="delete/bcc" data-item="' + item.id + '" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span> ' + lang.remove + '</a>' +
'</div>';
item.chkbox = '<input type="checkbox" data-id="bcc" name="multi_select" value="' + item.id + '" />';
if (item.type == 'sender') {
item.type = '<span id="active-script" class="label label-success">Sender</span>';
} else {
item.type = '<span id="inactive-script" class="label label-warning">Recipient</span>';
}
});
}
}),
"paging": {
"enabled": true,
"limit": 5,
"size": pagination_size
},
"filtering": {
"enabled": true,
"position": "left",
"placeholder": lang.filter_table
},
"sorting": {
"enabled": true
}
});
}
function draw_alias_table() {
ft_alias_table = FooTable.init('#alias_table', {
"columns": [
@@ -530,5 +579,6 @@ jQuery(function($){
draw_aliasdomain_table();
draw_sync_job_table();
draw_filter_table();
draw_bcc_table();
});