struct

JaneHQ::Web::AlertGroupForm

Inherits Struct < Value < Object

The values the alert group form posts, normalized. Kept as one struct so the create and update routes share parsing, validation and — when validation fails — re-rendering the form exactly as the user left it.

Constructors

defaults

A blank form: watching nothing yet, with M/Monit's default statuses.

Source
from_params(env) : AlertGroupForm

The pickers are plain checkbox groups (so the form works without JS), which means each arrives as a repeated body param.

Source
from_record(record : AlertGroupRecord, targets : Array(AlertTarget)) : AlertGroupForm
Source
new(name : String, enabled : Bool, targets : Array(JaneHQ::AlertTarget), services : Array(String), statuses : Array(String), events : Array(String), alert_type : String, alert_target : String, alert_count : String, alert_frequency_minutes : Int32)
Source

Instance methods

alert_count
Source
alert_frequency_minutes
Source
alert_target
Source
alert_type
Source
enabled
Source
event_summary
Source
events
Source
name
Source
recurring?
Source
service?(name : String) : Bool
Source
service_summary
Source
services
Source
status_summary
Source
statuses
Source
target?(token : String) : Bool

Selected-state lookups for the form's checkboxes.

Source
target_summary

Each picker's collapsed label. Rendered server-side so the form still reads correctly with JS disabled; public/alerts.js keeps them current.

Source
targets
Source
validate
Source