mirror of
https://github.com/ethauvin/fail2ban-digest.git
synced 2025-04-26 10:58:12 -07:00
Fixed HTML template spacing.
This commit is contained in:
parent
e8eafc027b
commit
f9d71346ba
1 changed files with 44 additions and 42 deletions
|
@ -48,60 +48,62 @@ Fail2ban Digest
|
||||||
default_html_template = Template('''<!DOCTYPE html>
|
default_html_template = Template('''<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
|
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
td, th {
|
td, th {
|
||||||
border: 1px solid darkgrey;
|
border: 1px solid darkgrey;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
td:last-child {
|
td:last-child {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background-color: #dddddd;
|
background-color: #dddddd;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>Hi,</p>
|
<p>Hi,</p>
|
||||||
<p>This is a digest email of banned IPs since <b>${creation_date}</b> and <b>${date_now}</b>:</p>
|
<p>This is a digest email of banned IPs since <b>${creation_date}</b> and <b>${date_now}</b>:</p>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align: center">#</th>
|
<th style="text-align: center">#</th>
|
||||||
<th style="text-align: center">IPs</th>
|
<th style="text-align: center">IPs</th>
|
||||||
<th>When</th>
|
<th>When</th>
|
||||||
</tr>
|
</tr>
|
||||||
${digest}
|
${digest}
|
||||||
</table>
|
</table>
|
||||||
<p>Regards,</p>
|
<p>Regards,</p>
|
||||||
<p><a href="https://github.com/enricotagliavini/fail2ban-digest">Fail2Ban Digest</a><p>
|
<p><a href="https://github.com/enricotagliavini/fail2ban-digest">Fail2Ban Digest</a><p>
|
||||||
</body>
|
</body>
|
||||||
<html>
|
<html>
|
||||||
''')
|
''')
|
||||||
html_tr_template = Template(''' <tr>
|
html_tr_template = Template(''' <tr>
|
||||||
<td style="text-align: center">${count}</td>
|
<td style="text-align: center">${count}</td>
|
||||||
<td style="text-align: right">${ip}</td>
|
<td style="text-align: right">${ip}</td>
|
||||||
<td>${events}</td>
|
<td>${events}</td>
|
||||||
</tr>
|
</tr>
|
||||||
''')
|
''')
|
||||||
html_error_template = Template(''' <tr>
|
html_error_template = Template(''' <tr>
|
||||||
<td colspan="3"><em>${error_msg}</em></td>
|
<td colspan="3"><em>${error_msg}</em></td>
|
||||||
</tr>''')
|
</tr>
|
||||||
|
''')
|
||||||
|
|
||||||
class Ban:
|
class Ban:
|
||||||
def __init__(self, ip, events):
|
def __init__(self, ip, events):
|
||||||
self.ip = ip
|
self.ip = ip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue