MediaDash/templates/logs.html
2021-08-29 15:03:28 +02:00

39 lines
No EOL
1.8 KiB
HTML

{% extends "base.html" %}
{% block app_content %}
<div class="row">
<h2>QBittorrent</h2>
<div class="monospace">
{% set t_first = logs.qbt[0].timestamp %}
{% for message in logs.qbt if "WebAPI login success" not in message.message %}
{%set type={1: 'status' , 2: 'info', 4: 'warning', 8:'danger'}.get(message.type,none) %}
{%set type_name={1: 'NORMAL' , 2: 'INFO', 4: 'WARNING', 8:'CRITICAL'}.get(message.type,none) %}
<p class="text-{{type}}">
[{{((message.timestamp-t_first)/1000) | timedelta}}|{{type_name}}] {{message.message.strip()}}
</p>
{% endfor %}
</div>
<h2>Sonarr</h2>
<div class="monospace">
{% set t_first = (logs.sonarr.records[0].time)|fromiso %}
{% for message in logs.sonarr.records %}
{%set type={'warn': 'warning', 'error':'danger'}.get(message.level,message.level) %}
<p class="text-{{type}}">
[{{message.time | fromiso | ago_dt}}|{{message.logger}}|{{message.level|upper}}] {{message.message.strip()}}
</p>
{% endfor %}
</div>
<h2>Radarr</h2>
<div class="monospace">
{% set t_first = (logs.radarr.records[0].time)|fromiso %}
{% for message in logs.radarr.records %}
{%set type={'warn': 'warning', 8:'danger'}.get(message.level,message.level) %}
<p class="text-{{type}}">
[{{message.time | fromiso | ago_dt}}|{{message.logger}}|{{message.level|upper}}] {{message.message.strip()}}
</p>
{% endfor %}
</div>
</div>
{% endblock %}