nicer layout for token log
This commit is contained in:
parent
9a0ae93a7b
commit
75ce8c46b8
|
@ -6,16 +6,26 @@
|
|||
{% block content %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<td>Date</td>
|
||||
<td>Timestamp</td>
|
||||
<td>Level</td>
|
||||
<td>Message</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in log %}
|
||||
{% if line[2] == 'INFO' %}
|
||||
<tr style="background-color: lightgreen">
|
||||
{% elif line[2] == 'WARNING'%}
|
||||
<tr style="background-color: orange">
|
||||
{% elif line[2] == 'ERROR' %}
|
||||
<tr style="background-color: red">
|
||||
{% elif line[2] == 'DEBUG'%}
|
||||
<tr style="background-color: lightblue">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
<td>{{ line[0] }}</td>
|
||||
<td>{{ line[1] }}</td>
|
||||
<td>{{ line[2] }}</td>
|
||||
<td>{{ line[3] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -484,7 +484,7 @@ def create_application(config):
|
|||
with open(config.nfc_log) as f:
|
||||
log += f.readlines()
|
||||
log.reverse()
|
||||
log = map(lambda l: l.split(' ', 2), log)
|
||||
log = [l.split(' - ') for l in log]
|
||||
return render_template('token_log.html', log=log)
|
||||
except Exception as e:
|
||||
flash(f"NFC logfile {Path(config.nfc_log).absolute()} konnte nicht gelesen werden. Exception: {e}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user