mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-19 05:53:51 -04:00
We want to align all our stats to be for the last 7 days. This means summing up the stats response from the API to make the Big Number. Previously the big number was counting sent notifications as successful. This commit changes it to only look at delivered notifications. Right now, the API doesn’t have a way of filtering to only show the last 7 days. So for the moment the dashboard will show statistics for all time. The upshot of this is that we can link from the dashboard to the activity page when there are failures.
30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
{% from "components/big-number.html" import big_number_with_status %}
|
|
|
|
<h2 class="heading-medium">
|
|
In the last 7 days
|
|
</h2>
|
|
<div class="grid-row bottom-gutter">
|
|
<div class="column-half">
|
|
{{ big_number_with_status(
|
|
statistics.get('emails_delivered', 0),
|
|
'email' if statistics.get('emails_delivered') == 1 else 'emails',
|
|
statistics.get('emails_failed'),
|
|
statistics.get('emails_failure_rate', 0.0),
|
|
statistics.get('emails_failure_rate', 0)|float > 3,
|
|
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='email', status='failed')
|
|
) }}
|
|
</div>
|
|
<div class="column-half">
|
|
{{ big_number_with_status(
|
|
statistics.get('sms_requested', 0),
|
|
'text message' if statistics.get('sms_requested') == 1 else 'text messages',
|
|
statistics.get('sms_failed'),
|
|
statistics.get('sms_failure_rate', 0.0),
|
|
statistics.get('sms_failure_rate', 0)|float > 3,
|
|
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='sms', status='failed')
|
|
) }}
|
|
</div>
|
|
</div>
|
|
|
|
{% include 'views/dashboard/template-statistics.html' %}
|