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