Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
1.3 kB
2
Indexable
Never
{% extends 'base2.html' %}
{% block title %}Logs Page{% endblock %}
{% block content %}
    <h1>{{ analname }} &nbsp &nbsp <a href="/analyser/{{ analname }}"><input type='submit' value='refresh'/></a> &nbsp &nbsp <a href="/"><input type='submit' value='back'/></a> &nbsp &nbsp <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> &nbsp &nbsp {% 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>
                {% for line in logs %}
                    {% set code = line.split(' - ') %}
                    {% if code[1] == 'INFO' %}
                        <div style="color:forestgreen;">{{ line }} <br></div>
                    {% elif code[1] == 'ERROR' %}
                        <div style="color:darkred;">{{ line }} <br></div>
                    {% else %}
                        <div>{{ line }} <br></div>
                    {% endif %}
                {% endfor %}
            </td>
        </tr>
    </table>
{% endblock %}