Untitled
unknown
python
3 years ago
2.0 kB
7
Indexable
{% extends 'base2.html' %}
{% block title %}Logs Page{% endblock %}
{% block content %}
<h1>{{ analname }}     <a href="/analyser/{{ analname }}"><input type='submit' value='refresh'/></a>     <a href="/"><input type='submit' value='back'/></a>     <button type="button" id="startstop" onclick="start_stop('{{ analname }}'); this.disabled = true;" {% if analysers[analname]['is_active'] == True %} disabled {% endif %} >{% if analysers[analname]['is_alive'] == True %}Stop{% else %}Start{% endif %}</button>     {% if analysers[analname]['is_alive'] == True %}<td style="text-align:center">🟩</td>{% else %}<td style="text-align:center">🟥</td>{% endif %}</h1>
<table>
<tr>
<th>logs</th>
</tr>
<tr>
<td>
{% set colour_code = namespace(colour='color:black;') %}
{% for line in logs %}
{% set code = line.split(' - ') %}
{% if code|length >= 2 %}
{% if code[1] == 'NOTSET' %}
{% set colour_code.colour = 'color:forestgreen;' %}
{% elif code[1] == 'DEBUG' %}
{% set colour_code.colour = 'color:forestgreen;' %}
{% elif code[1] == 'INFO' %}
{% set colour_code.colour = 'color:forestgreen;' %}
{% elif code[1] == 'WARNING' %}
{% set colour_code.colour = 'color:darkred;' %}
{% elif code[1] == 'ERROR' %}
{% set colour_code.colour = 'color:darkred;' %}
{% elif code[1] == 'CRITICAL' %}
{% set colour_code.colour = 'color:darkred;' %}
{% endif %}
{% endif %}
<div style="{{ colour_code.colour }}">{{ line }} <br></div>
{% endfor %}
</td>
</tr>
</table>
{% endblock %}
Editor is loading...