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
|
||||
|
||||
### 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)
|
||||
- Make log events fit better on mobile screens
|
||||
|
||||
|
@ -273,7 +273,7 @@ class Check(models.Model):
|
||||
ping.body = body[:10000]
|
||||
ping.save()
|
||||
|
||||
def downtimes(self, months=2):
|
||||
def downtimes(self, months=3):
|
||||
""" Calculate the number of downtimes and downtime minutes per month.
|
||||
|
||||
Returns a list of (datetime, downtime_in_secs, number_of_outages) tuples.
|
||||
|
@ -68,7 +68,7 @@ def format_approx_duration(td):
|
||||
return ""
|
||||
|
||||
|
||||
def month_boundaries(months=2):
|
||||
def month_boundaries(months=3):
|
||||
result = []
|
||||
|
||||
now = timezone.now()
|
||||
|
@ -7,9 +7,11 @@
|
||||
{{ group.grouper|mangle_link }}
|
||||
</td>
|
||||
{% 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;">
|
||||
{{ dt|date:"N Y"}}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% for check in group.list|sortchecks:sort %}
|
||||
@ -63,6 +65,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
{% for boundary, seconds, count in check.downtimes %}
|
||||
{% if not forloop.last %}
|
||||
{% if count %}
|
||||
<td style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
|
||||
{{ count }} downtime{{ count|pluralize }},
|
||||
@ -74,6 +77,7 @@
|
||||
All good!
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user