Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-28 07:24:56

0001 {% extends 'base.html' %}
0002 {% load static %}
0003 {% load swf_fmt %}
0004 
0005 {% block title %}Run report — {{ alarm_entry_id }} — Alarms{% endblock %}
0006 
0007 {% block content %}
0008 <link rel="stylesheet" href="{% static 'css/state-colors.css' %}">
0009 <style>
0010   .report-bundle {
0011     background: #111; color: #ddd; padding: 14px 18px;
0012     border-radius: 4px; font-family: "SF Mono", Monaco, Menlo, monospace;
0013     font-size: 13px; white-space: pre-wrap;
0014   }
0015   .report-bundle h3 {
0016     color: #daa520; font-size: 0.95em; margin: 1.2em 0 0.4em; font-weight: 600;
0017   }
0018   .report-bundle .det {
0019     border-top: 1px dashed #333; padding-top: 8px; margin-top: 10px;
0020   }
0021   .report-bundle .det-subject { color: #fff; font-weight: 600; margin-bottom: 4px; }
0022 </style>
0023 
0024 <div class="container mt-3" style="max-width: 1100px;">
0025   <p><a href="{% url 'monitor_app:alarms_dashboard' %}">&larr; All alarms</a></p>
0026 
0027   <h2 class="mb-1">Alarm run report</h2>
0028   <div class="text-muted mb-3">
0029     <code>{{ alarm_entry_id }}</code> — run started
0030     {{ run_started_at|fmt_dt }}
0031     {% if run_finished_at %}· finished {{ run_finished_at|fmt_dt }}{% endif %}
0032   </div>
0033 
0034   <table class="table table-sm mb-3" style="max-width:900px;">
0035     <tbody>
0036       <tr><th style="width:200px;">Emails (this alarm)</th>
0037           <td>{% if email_enabled %}on{% else %}off{% endif %}</td></tr>
0038       <tr><th>Bundle this tick</th>
0039           <td>
0040             {% if new_events or continuing_events %}
0041               {{ new_events|length }} new, {{ continuing_events|length }} continuing
0042             {% else %}
0043               empty
0044             {% endif %}
0045           </td></tr>
0046       <tr><th>Email shipped?</th>
0047           <td>{% if bundle_sent %}yes{% elif new_events or continuing_events %}no (emails off or no recipients){% else %}— (nothing to ship){% endif %}</td></tr>
0048       <tr><th>Recipients (resolved)</th>
0049           <td>{{ recipients|join:', '|default:'—' }}</td></tr>
0050       {% if errors %}
0051       <tr><th>Error</th>
0052           <td class="text-danger">{{ error_message|default:'yes' }}</td></tr>
0053       {% endif %}
0054     </tbody>
0055   </table>
0056 
0057   <h3 style="font-size:1em;">Email body (as it would be sent)</h3>
0058   <div class="report-bundle">
0059 <span style="color:#aaa;">Subject:</span> <span style="color:#fff;">{{ subject }}</span>
0060 {% if description %}
0061 
0062 {{ description }}
0063 
0064 ---
0065 {% endif %}
0066 {% if new_events %}
0067 <h3>NEW ({{ new_events|length }})</h3>
0068 {% for ev in new_events %}
0069 <div class="det">
0070 <div class="det-subject">[{{ forloop.counter }}] <a href="{% url 'monitor_app:alarm_event_detail' event_uuid=ev.id %}" style="color:#8fd3ff;">{{ ev.title|default:ev.data.subject }}</a></div>
0071 {% with body=ev.content %}{% if body %}{{ body }}{% endif %}{% endwith %}
0072 </div>
0073 {% endfor %}
0074 {% endif %}
0075 {% if continuing_events %}
0076 <h3>CONTINUING — renotification ({{ continuing_events|length }})</h3>
0077 {% for ev in continuing_events %}
0078 <div class="det">
0079 <div class="det-subject">[{{ forloop.counter }}] <a href="{% url 'monitor_app:alarm_event_detail' event_uuid=ev.id %}" style="color:#8fd3ff;">{{ ev.title|default:ev.data.subject }}</a></div>
0080 {% with body=ev.content %}{% if body %}{{ body }}{% endif %}{% endwith %}
0081 </div>
0082 {% endfor %}
0083 {% endif %}
0084 {% if not new_events and not continuing_events %}
0085 <em style="color:#888;">(nothing — this alarm had no bundle this tick)</em>
0086 {% endif %}
0087   </div>
0088 </div>
0089 {% endblock %}