<commit_before>{% extends 'base.html' %}

{% block content %}
<div class="container">
    <h1>
        {% if problems_only %}
        Problems
        {% else %}
        States
        {% endif %}
        <button id="expand-states" class="btn pull-right btn-default"
                data-toggle="tooltip" data-placement="bottom" title="Expand states">
            <span class="glyphicon glyphicon-align-left"></span>
        </button>
    </h1>

    <div class="panel-group">
        {% for host, states, status_counter, oldest_problem_date, might_be_starting, has_problems in states_by_host %}
        <div class="panel
                {% if status_counter.critical %}
                panel-danger
                {% elif status_counter.warning %}
                panel-warning
                {% elif status_counter.unknown %}
                panel-default
                {% else %}
                panel-success
                {% endif %}">
            <div class="panel-heading cursor-pointer" data-toggle="collapse" data-target="#host_{{ forloop.counter }}_states">
                {{ host }}
                {% if oldest_problem_date %}
                (since {{ oldest_problem_date|timesince }})
                {% elif has_problems and might_be_starting %}
                (host is probably starting up, no alerts sent)
                {% endif %}
                <div class="pull-right">
                    {% if status_counter.unknown %}
                    <span class="label label-default">{{ status_counter.unknown }}</span>
                    {% endif %}
                    {% if status_counter.critical %}
                    <span class="label label-danger">{{ status_counter.critical }}</span>
                    {% endif %}
                    {% if status_counter.warning %}
                    <span class="label label-warning">{{ status_counter.warning }}</span>
                    {% endif %}
                    {% if status_counter.passing %}
                    <span class="label label-success">{{ status_counter.passing }}</span>
                    {% endif %}
                </div>
            </div>
            <ul id="host_{{ forloop.counter }}_states" class="list-group collapse states-list">
                {% for state in states %}
                <li class="list-group-item">
                    <a href="{{ state.get_absolute_url }}">{{ state }}</a>

                    {% if state.status == Status.critical %}
                    <span class="label label-danger">
                    {% elif state.status == Status.warning %}
                    <span class="label label-warning">
                    {% elif state.status == Status.passing %}
                    <span class="label label-success">
                    {% else %}
                    <span class="label label-default">
                    {% endif %}
                    {{ state.get_status_display }}</span>

                    {{ state.output|default_if_none:'' }}
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endfor %}
    </div>

    {% if paginator.num_pages > 1 %}
    <ul class="pagination">
        {% for page in paginator.page_range %}
        <li{% if page_obj.number == page %} class="active"{% endif %}><a href="?page={{ page }}">{{ page }}</a></li>
        {% endfor %}
    </ul>
    {% endif %}<commit_msg>added a placeholder text in states list view when there are no states to show<commit_after>{% extends 'base.html' %}

{% block content %}
<div class="container">
    <h1>
        {% if problems_only %}
        Problems
        {% else %}
        States
        {% endif %}
        {% if states_by_host %}
        <button id="expand-states" class="btn pull-right btn-default"
                data-toggle="tooltip" data-placement="bottom" title="Expand states">
            <span class="glyphicon glyphicon-align-left"></span>
        </button>
        {% endif %}
    </h1>

    {% if states_by_host %}
    <div class="panel-group">
        {% for host, states, status_counter, oldest_problem_date, might_be_starting, has_problems in states_by_host %}
        <div class="panel
                {% if status_counter.critical %}
                panel-danger
                {% elif status_counter.warning %}
                panel-warning
                {% elif status_counter.unknown %}
                panel-default
                {% else %}
                panel-success
                {% endif %}">
            <div class="panel-heading cursor-pointer" data-toggle="collapse" data-target="#host_{{ forloop.counter }}_states">
                {{ host }}
                {% if oldest_problem_date %}
                (since {{ oldest_problem_date|timesince }})
                {% elif has_problems and might_be_starting %}
                (host is probably starting up, no alerts sent)
                {% endif %}
                <div class="pull-right">
                    {% if status_counter.unknown %}
                    <span class="label label-default">{{ status_counter.unknown }}</span>
                    {% endif %}
                    {% if status_counter.critical %}
                    <span class="label label-danger">{{ status_counter.critical }}</span>
                    {% endif %}
                    {% if status_counter.warning %}
                    <span class="label label-warning">{{ status_counter.warning }}</span>
                    {% endif %}
                    {% if status_counter.passing %}
                    <span class="label label-success">{{ status_counter.passing }}</span>
                    {% endif %}
                </div>
            </div>
            <ul id="host_{{ forloop.counter }}_states" class="list-group collapse states-list">
                {% for state in states %}
                <li class="list-group-item">
                    <a href="{{ state.get_absolute_url }}">{{ state }}</a>

                    {% if state.status == Status.critical %}
                    <span class="label label-danger">
                    {% elif state.status == Status.warning %}
                    <span class="label label-warning">
                    {% elif state.status == Status.passing %}
                    <span class="label label-success">
                    {% else %}
                    <span class="label label-default">
                    {% endif %}
                    {{ state.get_status_display }}</span>

                    {{ state.output|default_if_none:'' }}
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endfor %}
    </div>
    {% else %}
    <p>No states</p>
    {% endif %}

    {% if paginator.num_pages > 1 %}
    <ul class="pagination">
        {% for page in paginator.page_range %}
        <li{% if page_obj.number == page %} class="active"{% endif %}><a href="?page={{ page }}">{{ page }}</a></li>
        {% endfor %}
    </ul>
    {% endif %}
{'fraction_non_alphanumeric': 0.13824289405684753, 'fraction_numerical': 0.0008613264427217916, 'mean_word_length': 1.460967855881314, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7483227', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1683, 'n_words': 397}