Add Domain and Mailbox tagging (#4569)
* [Web] define tag tables * [Web] add mailbox tag functions * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * Include new tags lang in language.en.json * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging * [Web] add domain/mailbox tagging Co-authored-by: Niklas Meyer <62480600+DerLinkman@users.noreply.github.com>
This commit is contained in:
@@ -236,9 +236,6 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
jQuery(function($){
|
||||
// http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
|
||||
var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};
|
||||
function escapeHtml(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})}
|
||||
// http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
||||
function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e<B.length-1);return i.toFixed(1)+" "+B[e]}
|
||||
function unix_time_format(i){return""==i?'<i class="bi bi-x-lg"></i>':new Date(i?1e3*i:0).toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}
|
||||
@@ -293,6 +290,7 @@ jQuery(function($){
|
||||
{"name":"rl","title":"RL","breakpoints":"xs sm md lg","style":{"min-width":"100px","width":"100px"}},
|
||||
{"name":"backupmx","filterable": false,"style":{"min-width":"120px","width":"120px"},"title":lang.backup_mx,"breakpoints":"xs sm md lg","formatter": function(value){return 1==value?'<i class="bi bi-check-lg"></i>':0==value&&'<i class="bi bi-x-lg"></i>';}},
|
||||
{"name":"domain_admins","title":lang.domain_admins,"style":{"word-break":"break-all","min-width":"200px"},"breakpoints":"xs sm md lg","filterable":(role == "admin"),"visible":(role == "admin")},
|
||||
{"name":"tags","title":"Tags","style":{},"breakpoints":"xs sm md lg"},
|
||||
{"name":"active","filterable": false,"style":{"min-width":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'<i class="bi bi-check-lg"></i>':0==value&&'<i class="bi bi-x-lg"></i>';}},
|
||||
{"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","min-width":"240px","width":"240px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
|
||||
],
|
||||
@@ -330,6 +328,13 @@ jQuery(function($){
|
||||
'<a href="#dnsInfoModal" class="btn btn-xs btn-xs-half btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.domain_name) + '"><i class="bi bi-globe2"></i> DNS</a></div>';
|
||||
}
|
||||
|
||||
if (Array.isArray(item.tags)){
|
||||
var tags = '';
|
||||
for (var i = 0; i < item.tags.length; i++)
|
||||
tags += '<span class="badge badge-primary tag-badge"><i class="bi bi-tag-fill"></i> ' + escapeHtml(item.tags[i]) + '</span>';
|
||||
item.tags = tags;
|
||||
}
|
||||
|
||||
if (item.backupmx == 1) {
|
||||
if (item.relay_unknown_only == 1) {
|
||||
item.domain_name = '<div class="label label-info">Relay Non-Local</div> ' + item.domain_name;
|
||||
@@ -418,6 +423,7 @@ jQuery(function($){
|
||||
},
|
||||
{"name":"messages","filterable": false,"title":lang.msg_num,"breakpoints":"xs sm md"},
|
||||
/* {"name":"rl","title":"RL","breakpoints":"all","style":{"width":"125px"}}, */
|
||||
{"name":"tags","title":"Tags","style":{},"breakpoints":"xs sm md lg"},
|
||||
{"name":"active","filterable": false,"style":{"min-width":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'<i class="bi bi-check-lg"></i>':(0==value?'<i class="bi bi-x-lg"></i>':2==value&&'—');}},
|
||||
{"name":"action","filterable": false,"sortable": false,"style":{"min-width":"290px","text-align":"right"},"type":"html","title":lang.action,"breakpoints":"xs sm md"}
|
||||
],
|
||||
@@ -497,6 +503,13 @@ jQuery(function($){
|
||||
'<div class="progress-bar-mailbox progress-bar progress-bar-' + item.percent_class + '" role="progressbar" aria-valuenow="' + item.percent_in_use + '" aria-valuemin="0" aria-valuemax="100" ' +
|
||||
'style="min-width:2em;width:' + item.percent_in_use + '%">' + item.percent_in_use + '%' + '</div></div>';
|
||||
item.username = escapeHtml(item.username);
|
||||
|
||||
if (Array.isArray(item.tags)){
|
||||
var tags = '';
|
||||
for (var i = 0; i < item.tags.length; i++)
|
||||
tags += '<span class="badge badge-primary tag-badge"><i class="bi bi-tag-fill"></i> ' + escapeHtml(item.tags[i]) + '</span>';
|
||||
item.tags = tags;
|
||||
}
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
Reference in New Issue
Block a user