feat(alerting): add monitor alert groups with default routing
This commit is contained in:
1 parent
52819e64bb
commit
8544e5a585
26 files changed
+2938
-1473
No files matched your search
@@ -450,6 +450,7 @@ type RegionOption struct {
|
||||
|
||||
// MonitorForm is the data of the monitor editor; ID is empty for new ones.
|
||||
type MonitorForm struct {
|
||||
AlertGroups []AlertGroupOption
|
||||
ID string
|
||||
Name string
|
||||
Type string
|
||||
@@ -611,6 +612,11 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
|
||||
<div>
|
||||
@formError()
|
||||
@valueField(i18n.T(ctx, "sso.field.name"), "name", f.Name, "", true)
|
||||
<fieldset class="mb-6">
|
||||
<legend class="mb-2 text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "alert_groups.title") }</legend>
|
||||
@alertGroupOptions("alert_group_ids", f.AlertGroups)
|
||||
<p class="mt-2 text-xs text-muted">{ i18n.T(ctx, "alert_groups.monitor_hint") }</p>
|
||||
</fieldset>
|
||||
<label class="mb-4 block">
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "groups.group") }</span>
|
||||
@groupSelect("group_id", f.Groups, f.GroupID, f.TopLevel)
|
||||
@@ -875,6 +881,7 @@ type ChannelRow struct {
|
||||
|
||||
// ChannelsView is the data of the notification channels page.
|
||||
type ChannelsView struct {
|
||||
AlertGroups []AlertGroupRow
|
||||
Channels []ChannelRow
|
||||
EmailAvailable bool
|
||||
CanWrite bool
|
||||
@@ -885,6 +892,7 @@ type ChannelsView struct {
|
||||
templ ChannelsPage(p Page, me Me, v ChannelsView) {
|
||||
@consoleShell(p, me) {
|
||||
@settingsHeading("channels.title", "channels.intro")
|
||||
@alertGroupsSettings(v)
|
||||
if len(v.Channels) > 0 {
|
||||
<ul class="mb-12 divide-y divide-rule border-y border-rule text-sm">
|
||||
for _, ch := range v.Channels {
|
||||
|
||||
Reference in new issue
Block a user