package web import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" // AlertGroupOption is a selectable group or channel in an alert routing form. type AlertGroupOption struct { ID string Name string Default bool Checked bool } // AlertGroupRow describes a group and its available notification channels. type AlertGroupRow struct { ID string Name string Default bool Channels []AlertGroupOption } templ alertGroupOptions(name string, options []AlertGroupOption) { for _, opt := range options { } } templ alertGroupsSettings(v ChannelsView) {
@sectionHeading("alert_groups.title")

{ i18n.T(ctx, "alert_groups.intro") }

for _, g := range v.AlertGroups {
@formError() if g.Default {

{ i18n.T(ctx, "alert_groups.default") }

}
@valueField(i18n.T(ctx, "sso.field.name"), "name", g.Name, "", true) @alertGroupOptions("channel_ids", g.Channels) if len(g.Channels) == 0 {

{ i18n.T(ctx, "alert_groups.no_channels") }

} if v.CanWrite { @submit(i18n.T(ctx, "alert_groups.save")) }
if v.CanWrite && !g.Default { }
} if v.CanWrite {
@sectionHeading("alert_groups.new") @formError() @valueField(i18n.T(ctx, "sso.field.name"), "name", "", "", true) for _, ch := range v.Channels { } @submit(i18n.T(ctx, "alert_groups.create"))
}
}