|
|
@ -1,3 +1,5 @@ |
|
|
|
from datetime import timedelta as td |
|
|
|
|
|
|
|
from django import forms |
|
|
|
from django.core.validators import RegexValidator |
|
|
|
from hc.front.validators import (CronExpressionValidator, TimezoneValidator, |
|
|
@ -23,6 +25,12 @@ class TimeoutForm(forms.Form): |
|
|
|
timeout = forms.IntegerField(min_value=60, max_value=2592000) |
|
|
|
grace = forms.IntegerField(min_value=60, max_value=2592000) |
|
|
|
|
|
|
|
def clean_timeout(self): |
|
|
|
return td(seconds=self.cleaned_data["timeout"]) |
|
|
|
|
|
|
|
def clean_grace(self): |
|
|
|
return td(seconds=self.cleaned_data["grace"]) |
|
|
|
|
|
|
|
|
|
|
|
class CronForm(forms.Form): |
|
|
|
schedule = forms.CharField(max_length=100, |
|
|
|