1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-25 02:29:32 +02:00

Merge pull request #5729 from mailcow/feat/readable-domainnames

[Web] display human readable domainnames instead of punycode
This commit is contained in:
Patrick Schult 2024-02-14 09:36:20 +01:00 committed by GitHub
commit 705d144a85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 4 deletions

View File

@ -4316,6 +4316,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
$domaindata['mboxes_in_domain'] = $MailboxDataDomain['count'];
$domaindata['mboxes_left'] = $row['mailboxes'] - $MailboxDataDomain['count'];
$domaindata['domain_name'] = $row['domain'];
$domaindata['domain_h_name'] = idn_to_utf8($row['domain']);
$domaindata['description'] = $row['description'];
$domaindata['max_num_aliases_for_domain'] = $row['aliases'];
$domaindata['max_num_mboxes_for_domain'] = $row['mailboxes'];

View File

@ -451,6 +451,10 @@ jQuery(function($){
dataSrc: function(json){
$.each(json.data, function(i, item) {
item.domain_name = escapeHtml(item.domain_name);
item.domain_h_name = escapeHtml(item.domain_h_name);
if (item.domain_name != item.domain_h_name){
item.domain_h_name = item.domain_h_name + '<small class="d-block">' + item.domain_name + '</small>';
}
item.aliases = item.aliases_in_domain + " / " + item.max_num_aliases_for_domain;
item.mailboxes = item.mboxes_in_domain + " / " + item.max_num_mboxes_for_domain;
@ -489,11 +493,11 @@ jQuery(function($){
if (item.backupmx == 1) {
if (item.relay_unknown_only == 1) {
item.domain_name = '<div class="badge fs-6 bg-info">Relay Non-Local</div> ' + item.domain_name;
item.domain_h_name = '<div class="badge fs-7 bg-info">Relay Non-Local</div> ' + item.domain_h_name;
} else if (item.relay_all_recipients == 1) {
item.domain_name = '<div class="badge fs-6 bg-info">Relay All</div> ' + item.domain_name;
item.domain_h_name = '<div class="badge fs-7 bg-info">Relay All</div> ' + item.domain_h_name;
} else {
item.domain_name = '<div class="badge fs-6 bg-info">Relay</div> ' + item.domain_name;
item.domain_h_name = '<div class="badge fs-7 bg-info">Relay</div> ' + item.domain_h_name;
}
}
});
@ -521,7 +525,7 @@ jQuery(function($){
},
{
title: lang.domain,
data: 'domain_name',
data: 'domain_h_name',
responsivePriority: 3,
defaultContent: ''
},

View File

@ -26,6 +26,15 @@
<input type="hidden" value="0" name="gal">
<input type="hidden" value="0" name="relay_all_recipients">
<input type="hidden" value="0" name="relay_unknown_only">
<div class="row mb-4">
<label class="control-label col-sm-2" for="domain">{{ lang.mailbox.domain }}</label>
<div class="col-sm-10">
<span class="d-block"><strong>{{ result.domain_h_name }}</strong></span>
{% if result.domain_h_name != result.domain_name %}
<small>{{ result.domain_name }}</small>
{% endif %}
</div>
</div>
<div class="row mb-2" data-acl="{{ acl.domain_desc }}">
<label class="control-label col-sm-2" for="description">{{ lang.edit.description }}</label>
<div class="col-sm-10">