<!DOCTYPE html>
{% load staticfiles %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Alerts</title>
    <script src="https://yandex.st/jquery/2.0.3/jquery.min.js"></script>
</head>
<style>
    a {
        text-decoration: none;
        color: #f462b5;
    }
</style>
<script type="text/javascript">
    function reload() {
        window.location.reload();
    }
    function clear_alerts() {
        //alert('not implemented');
        var wind = window.open('{% url  "clear_alerts"%}/?do=1');
        wind.focus();
        setTimeout(reload, 4000);
    }
</script>
<body>
<h3>Saas alerts</h3>
<a href="{% url 'status_alerts' %}" target="_blank" style="font-weight:bold">Actuality</a>
<div>
<h4>Panels by signal:</h4>
    {% for sigkey in signals %}
    <a href="{% url 'alerts_panel' %}/?filter={{ sigkey }}"
       target="_blank" style="font-weight:bold">
        {{ sigkey }}</a><br>
    {% endfor %}
</div>
    <br>
{% if unactuals %}
    <div>
        Unexisting services found ({{ unactuals|length }})
        <button onclick="clear_alerts()" style="background-color:violet">Clear</button>
    <br>{% for unact in unactuals %}{{ unact }} {% endfor %}
    </div>
{% endif %}
<div>
    <h4>Services with alerts:</h4>
    {% for serv in services %}
        <a href="{% url 'service_alerts' %}/?service={{ serv }}" target="_blank">
            {{ serv }}</a><br>
    {% endfor %}
    <br>
</div>
</body>
</html>
