forked from GithubBackups/healthchecks
In monthly reports, no downtime stats for the current month (month has just started)
This commit is contained in:
parent
052700a642
commit
9cbd3bfc5a
@ -3,8 +3,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Bug Fixes
|
### Improvements
|
||||||
|
- In monthly reports, no downtime stats for the current month (month has just started)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
- On mobile, "My Checks" page, always show the gear (Details) button (#286)
|
- On mobile, "My Checks" page, always show the gear (Details) button (#286)
|
||||||
- Make log events fit better on mobile screens
|
- Make log events fit better on mobile screens
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ class Check(models.Model):
|
|||||||
ping.body = body[:10000]
|
ping.body = body[:10000]
|
||||||
ping.save()
|
ping.save()
|
||||||
|
|
||||||
def downtimes(self, months=2):
|
def downtimes(self, months=3):
|
||||||
""" Calculate the number of downtimes and downtime minutes per month.
|
""" Calculate the number of downtimes and downtime minutes per month.
|
||||||
|
|
||||||
Returns a list of (datetime, downtime_in_secs, number_of_outages) tuples.
|
Returns a list of (datetime, downtime_in_secs, number_of_outages) tuples.
|
||||||
|
@ -68,7 +68,7 @@ def format_approx_duration(td):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def month_boundaries(months=2):
|
def month_boundaries(months=3):
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
|
@ -7,9 +7,11 @@
|
|||||||
{{ group.grouper|mangle_link }}
|
{{ group.grouper|mangle_link }}
|
||||||
</td>
|
</td>
|
||||||
{% for dt in month_boundaries %}
|
{% for dt in month_boundaries %}
|
||||||
|
{% if not forloop.last %}
|
||||||
<td style="padding: 32px 8px 8px 8px; margin: 0; font-size: 12px; color: #9BA2AB; font-family: Helvetica, Arial, sans-serif;">
|
<td style="padding: 32px 8px 8px 8px; margin: 0; font-size: 12px; color: #9BA2AB; font-family: Helvetica, Arial, sans-serif;">
|
||||||
{{ dt|date:"N Y"}}
|
{{ dt|date:"N Y"}}
|
||||||
</td>
|
</td>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for check in group.list|sortchecks:sort %}
|
{% for check in group.list|sortchecks:sort %}
|
||||||
@ -63,6 +65,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% for boundary, seconds, count in check.downtimes %}
|
{% for boundary, seconds, count in check.downtimes %}
|
||||||
|
{% if not forloop.last %}
|
||||||
{% if count %}
|
{% if count %}
|
||||||
<td style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
|
<td style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
|
||||||
{{ count }} downtime{{ count|pluralize }},
|
{{ count }} downtime{{ count|pluralize }},
|
||||||
@ -74,6 +77,7 @@
|
|||||||
All good!
|
All good!
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user