-
-
Notifications
You must be signed in to change notification settings - Fork 383
/
domain_detail.html
224 lines (211 loc) · 8.35 KB
/
domain_detail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
{% extends "admin/header.html" %}
{% load admin_tags i18n lib_tags %}
{% block extra_css %}
{{ block.super }}
{% extra_static_content "domains" "css" user %}
{% endblock %}
{% block leftcol %}
<ul class="nav nav-sidebar">
{% domains_menu "domains" user False %}
</ul>
{% get_extra_admin_content user "leftcol" selection %}
{% endblock %}
{% block apparea %}
<h2>{{ object }} {% if not object.enabled %} <small>{% trans "(disabled)" %}</small>{% endif %}</h2>
<hr>
<div class="col-xs-12 col-sm-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">{% trans "Summary" %}</h3>
</div>
<table class="table">
<tr>
<th width="40%">{% trans "Creation date" %}</th>
<td>{{ domain.creation }}</td>
</tr>
<tr>
<th>{% trans "Last modification date" %}</th>
<td>{{ domain.last_modification }}</td>
</tr>
<tr>
<th>{% trans "Domain aliases" %}</th>
<td>{{ domain.domainalias_count }}</td>
</tr>
<tr>
<th><a href="{% url 'admin:identity_list' %}#list/?searchquery=@{{ object.name }}&idtfilter=account">{% trans "Mailboxes" %}</a></th>
<td>{{ domain.mailbox_count }}</td>
</tr>
<tr>
<th><a href="{% url 'admin:identity_list' %}#list/?searchquery=@{{ object.name }}&idtfilter=alias">{% trans "Mailbox aliases" %}</a></th>
<td>{{ domain.mbalias_count }}</td>
</tr>
<tr>
<th>{% trans "Quota" %}</a></th>
<td>{{ domain.quota }} {% trans "MB" %}</td>
</tr>
{% if domain.quota %}
<tr>
<th>{% trans "Usage" %}</a></th>
<td>
<div class="progress">
<div class="{% progress_color domain.used_quota_in_percent %}" style="width: {{ domain.used_quota_in_percent }}%" title="{{ domain.used_quota_in_percent }}% ({{ domain.used_quota }} {% trans "MB" %}) {% trans 'used' context 'quota' %}"></div>
<div class="{% progress_color domain.allocated_quota_in_percent %}" style="width: {{ domain.allocated_quota_in_percent }}%" title="{{ domain.allocated_quota_in_percent }}% ({{ domain.allocated_quota }} {% trans "MB" %}) {% trans 'allocated' %}"></div>
</div>
</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Default mailbox quota" %}</a></th>
<td>{{ domain.default_mailbox_quota }} {% trans "MB" %}</td>
</tr>
{% if domain.message_limit != None %}
<tr>
<th>{% trans "Message sending limit" %}</a></th>
<td>{{ domain.message_limit }} {% trans "per day" %}</td>
</tr>
<tr>
<th>{% trans "Usage" %}</a></th>
<td>
<div class="progress">
<div class="{% progress_color domain.sent_messages_in_percent %}" style="width: {{ domain.sent_messages_in_percent }}%" title="{{ domain.sent_messages_in_percent }}% ({{ domain.sent_messages }}) {% trans 'used' context 'message count' %}"></div>
</div>
</td>
</tr>
{% endif %}
</table>
</div>
{% if object.domainalias_set.exists %}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">{% trans "Domain aliases" %}</h3>
</div>
<table class="table">
{% for domainalias in object.domainalias_set.all %}
<tr><td>{{ domainalias }}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
{% for template in templates.left %}
{% include template %}
{% endfor %}
</div>
<div class="col-xs-12 col-sm-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
{% trans "DNS" %}
<a href="{% url 'dnstools:domain_dns_configuration' domain.pk %}"
data-toggle="ajaxmodal"><span class="fa fa-info-circle"></span></a>
</h3>
</div>
<table class="table">
{% if enable_mx_checks or enable_dnsbl_checks %}
<tr>
<th>{% trans "Status" %}</th>
<td>
{% include "admin/_domain_dnschecks_status.html" %}
</td>
</tr>
{% endif %}
<tr>
<th>{% trans "DKIM key" %}</th>
<td>
{% if domain.dkim_public_key %}
<button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#domain_dkim_key">
{% trans "Show key" %}
</button>
<button data-toggle="modal" class="btn btn-default btn-xs" data-target="#dkim_regenerate_dialog"><span class="fa fa-refresh"></span></button>
<div class="modal fade" id="dkim_regenerate_dialog" tabindex="-1" role="dialog" aria-labelledby="dkim_regenerate_dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="dkim_regenerate_dialog">{% trans "Warning" %}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
{% trans "DKIM keys already exist for this domain. Do you want to overwrite them?" %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "No" %}</button>
<a id="refresh_dkim_key" class="btn btn-danger" href="#" title="{% trans 'Generate new key' %}" data-dismiss="modal">{% trans "Yes" %}</a>
</div>
</div>
</div>
</div>
{% else %}
{% trans "Not generated" %}
{% endif %}
</td>
</tr>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">{% trans "Administrators" %}</h3></div>
<table id="domadmins" class="table">
<thead>
<tr><th>{% trans "Username" %}</th><th>{% trans "Name" %}</th><th></th></tr>
</thead>
<tbody>
{% for da in domain.admins %}
<tr>
<td>{{ da.username }}</td>
<td>{{ da.fullname }}</td>
<td name="actions">
{% if perms.admin.change_domain %}
<a name="removeperm" href="{% url 'admin:permission_remove' %}?domid={{ domain.id }}&daid={{ da.id }}" title="{% trans 'Remove this permission' %}"><span class="fa fa-trash"></span></a>
{% endif %}
</td>
</tr>
{% empty %}
<tr><td colspan="3">{% trans "No domain administrator defined yet." %}</td></tr>
{% endfor %}
</tbody>
</table>
</div>
{% for template in templates.right %}
{% include template %}
{% endfor %}
</div>
{% if domain.dkim_public_key %}
<div class="modal fade" id="domain_dkim_key" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
{% include "admin/_domain_dkim_key.html" %}
</div>
{% endif %}
{% endblock %}
{% block extra_js %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function () {
$('#refresh_dkim_key').click(function (evt) {
evt.preventDefault();
var $this = $(this);
$.ajax({
url: '/api/v1/domains/{{ domain.pk }}/',
method: 'PATCH',
data: {
dkim_public_key: '',
dkim_private_key_path: ''
}
}).done(function (response) {
window.location.reload();
});
});
$('a[name="removeperm"]').click(function (evt) {
evt.preventDefault();
var $this = $(this);
$.ajax({
url: $this.attr('href'),
method: 'DELETE'
}).done(function () {
window.location.reload();
});
});
});
function copy(id) {
navigator.clipboard.writeText(document.getElementById(id).textContent);
}
</script>
{% endblock %}