feat(api): Configurable response time badge thresholds (#309)

* recreated all changes for setting thresholds on Uptime Badges

* Suggestion accepted: Update core/ui/ui.go

Co-authored-by: TwiN <twin@linux.com>

* Suggestion accepted: Update core/ui/ui.go

Co-authored-by: TwiN <twin@linux.com>

* implemented final suggestions by Twin

* Update controller/handler/badge.go

* Update README.md

* test: added the suggestons to set the UiConfig at another line

Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
Jesibu
2022-08-11 03:05:34 +02:00
committed by GitHub
parent 1aa94a3365
commit 1bce4e727e
7 changed files with 205 additions and 47 deletions

View File

@ -145,6 +145,10 @@ func (endpoint *Endpoint) ValidateAndSetDefaults() error {
}
if endpoint.UIConfig == nil {
endpoint.UIConfig = ui.GetDefaultConfig()
} else {
if err := endpoint.UIConfig.ValidateAndSetDefaults(); err != nil {
return err
}
}
if endpoint.Interval == 0 {
endpoint.Interval = 1 * time.Minute