|
|
@ -12,23 +12,6 @@ STATUSES = (("up", "Up"), ("down", "Down"), ("new", "New")) |
|
|
|
DEFAULT_TIMEOUT = td(days=1) |
|
|
|
DEFAULT_GRACE = td(hours=1) |
|
|
|
|
|
|
|
DURATION_CHOICES = ( |
|
|
|
("1 minute", td(minutes=1)), |
|
|
|
("2 minutes", td(minutes=2)), |
|
|
|
("5 minutes", td(minutes=5)), |
|
|
|
("10 minutes", td(minutes=10)), |
|
|
|
("15 minutes", td(minutes=15)), |
|
|
|
("30 minutes", td(minutes=30)), |
|
|
|
("1 hour", td(hours=1)), |
|
|
|
("3 hours", td(hours=3)), |
|
|
|
("6 hours", td(hours=6)), |
|
|
|
("12 hours", td(hours=12)), |
|
|
|
("1 day", td(days=1)), |
|
|
|
("2 days", td(days=2)), |
|
|
|
("3 days", td(days=3)), |
|
|
|
("1 week", td(weeks=1)) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
class Check(models.Model): |
|
|
|
name = models.CharField(max_length=100, blank=True) |
|
|
@ -46,7 +29,6 @@ class Check(models.Model): |
|
|
|
|
|
|
|
def send_alert(self): |
|
|
|
ctx = { |
|
|
|
"timeout_choices": DURATION_CHOICES, |
|
|
|
"check": self, |
|
|
|
"checks": self.user.check_set.order_by("created"), |
|
|
|
"now": timezone.now() |
|
|
|