diff --git a/asset/assets_vfsdata.go b/asset/assets_vfsdata.go index 3dd06e052b..b1e2c3f59c 100644 --- a/asset/assets_vfsdata.go +++ b/asset/assets_vfsdata.go @@ -161,9 +161,9 @@ var Assets = func() http.FileSystem { "/templates/default.tmpl": &vfsgen۰CompressedFileInfo{ name: "default.tmpl", modTime: time.Date(1970, 1, 1, 0, 0, 1, 0, time.UTC), - uncompressedSize: 8101, + uncompressedSize: 8202, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\x59\xcf\x6f\xeb\x36\x0c\xbe\xe7\xaf\x20\xfc\x76\x68\x0e\xf5\x1b\x76\x2c\x50\x0c\x0f\xc3\x7e\x1c\xba\x61\x68\xd1\x5d\x86\x21\x50\x6d\xc6\x55\x2b\x4b\xae\x44\x27\x0d\xd2\xfc\xef\x83\x6c\xc7\x91\x2d\x27\x91\xd3\xec\xb4\xdc\x12\x99\xfc\x48\x7f\x1f\x4d\xca\xf2\x7a\x0d\x29\xce\xb9\x44\x88\x66\x33\x26\x50\x53\xce\x24\xcb\x50\x47\xb0\xd9\x7c\x73\xfe\xaf\xd7\x80\x32\x85\xcd\x66\xb2\xd7\xe5\xf1\xfe\xce\x7a\xad\xd7\x10\xff\xfc\x4e\xa8\x25\x13\x8f\xf7\x77\xb0\xd9\x7c\xfd\xf2\xb5\xb2\x33\x3f\x6a\x4c\x90\x2f\x50\xdf\x5a\xa3\xfb\xe6\x0f\x7c\x40\xa9\xc5\x5b\x89\x7a\x55\xbb\x37\x81\xba\x91\x4c\xf9\xf4\x82\x09\xd9\x08\x7f\x5b\xef\x07\x62\x54\x1a\xf8\x00\x52\x8f\x45\x81\xba\x76\xe5\x73\xc0\xb7\xf6\x62\x34\xe7\x9a\xcb\xcc\xfa\xdc\x58\x9f\xea\x86\x4c\xfc\x4b\xb5\x0a\x1f\x20\x50\xba\x11\xff\x01\x6b\xf4\xab\x56\x65\x71\xc7\x9e\x50\x98\xf8\x41\x69\xc2\xf4\x4f\xc6\xb5\x89\xff\x62\xa2\x44\x1b\xf0\x45\x71\x09\x11\x58\x54\xa8\x43\x66\x04\x57\x16\x2b\xfe\x49\xe5\xb9\x92\xb5\xf3\xb4\x59\x73\xf0\xa6\xb0\xd9\x5c\xad\xd7\xb0\xe4\xf4\xdc\x35\x8e\xef\x31\x57\x0b\xec\x46\xff\x83\xe5\x68\x1a\x46\x87\xa2\xb7\x89\x4f\xdb\x5f\x7b\x64\x4a\xd1\x24\x9a\x17\xc4\x95\x8c\x0e\x70\x4c\xf8\x4e\xb5\xa4\x33\xc1\x0d\x35\xa6\x9a\xc9\x0c\x21\x86\xcd\xa6\xce\xeb\x66\xb2\x5b\xf4\x79\xb2\xac\x5c\x57\x44\xda\xf4\xed\xbf\x5b\x68\x6f\xa0\x49\xac\x0e\xfe\x4d\x4a\x45\xcc\xe6\xd4\x81\x74\x96\x4f\xc3\x7d\x50\xa5\x4e\xf0\xa6\x16\x13\x25\x6a\x46\x4a\xd7\x95\x38\x19\x20\xea\x20\x05\xb3\x9c\xe9\xd7\x54\x2d\xa5\xc7\xc5\x24\x94\x8c\xc0\xac\x27\xe3\xe9\x08\x45\x0e\x22\x64\x32\xcc\x88\x11\x2c\x79\x8d\x53\x9c\xb3\x52\x50\x4c\x9c\x04\x36\x54\x10\xe6\x85\x60\xd4\x7d\x38\xe3\x7d\x35\xd8\xc5\x29\x8d\x6d\x0f\xf9\x10\x54\xb7\x09\x05\xe2\xcd\x99\x10\x4f\x2c\x79\xf5\xf0\x06\xd3\xb7\xa0\xf0\x01\xc7\x0c\x05\x97\xaf\xc1\x19\x24\x4d\x06\x3c\x8d\xc2\x1c\x0a\x8d\xb6\xd6\x02\xad\x9d\x84\x0e\x32\x56\xf5\xe0\xc0\x94\x79\xa2\x24\xe6\xea\x85\x47\xe1\xf6\xa5\x16\xa1\x19\x87\xdf\xdc\x5c\x29\xaa\x27\x8e\x53\x83\xae\x79\x61\x6f\x2d\x2d\x69\xd5\xba\xf8\x0d\x6d\x5c\x39\xfa\x88\x89\xe0\x28\xe9\xf4\x82\xdc\x87\xb8\x9b\x8a\xa7\x69\xe6\xe3\x72\x69\x88\xc9\x04\xcd\x00\xae\xd7\xc1\xe3\xfd\xac\xaa\xc2\x64\x28\x39\xb6\xc0\x39\x1a\xc3\xb2\xd3\x9e\x6f\x0f\xcc\x57\xa8\x19\x78\x7b\x1a\xda\xe0\x84\x9b\xf4\xe6\x6b\x67\x80\x4f\xe1\x7b\xb8\xb6\x8d\xb3\x5a\x84\x7a\xb1\x6a\x9d\x87\x19\xe9\xee\x02\xaa\x20\xd7\xce\x1d\x0d\xc4\xbb\x47\xa3\xc4\x02\xd3\x5e\xc4\xed\x72\x78\xcc\xad\x87\x17\xf5\x3a\x84\x52\x53\xf5\xf1\xf1\xd5\xd4\x51\x7d\x89\xc9\x33\xa3\xb1\x9a\x4f\x2e\xfa\x1d\xd0\xcf\xdd\x28\x3f\x6a\xe1\xe1\x0d\xea\xb3\x47\xf5\x9e\x3e\xa4\x66\x76\x58\xee\xed\xa4\xbe\x79\xc1\x34\xad\x46\xd8\x13\xcb\x42\xad\x59\x86\x92\x66\xfd\x11\xd7\xad\xaf\x05\x4f\x48\x69\x55\x98\x5d\xd9\x12\x23\x9c\x75\x0b\xed\x52\x4b\xe3\x7a\x81\xcf\x2a\x4a\xe2\xb4\x9a\xa5\xdc\x14\x82\xad\x66\x7b\x76\x53\xc7\x1b\xb7\x8f\x9c\x2b\xc9\x49\x59\x42\x66\xa4\x94\x18\x39\x12\x3b\xb3\xab\x34\xcf\x6a\x81\xfa\x0c\xfb\x47\x0f\xea\xbf\xaf\xa7\xf3\x94\x53\x78\x35\x9d\xaf\x98\xfc\x2d\xfd\x21\x26\x77\x7b\xba\x31\x33\xc5\xdd\xcd\x49\xe7\x61\xdf\xbd\xa6\x8f\x7f\x47\x70\x70\x2e\xf2\x8e\x91\xd7\x65\x91\x50\x60\xa6\x59\x3e\x44\xe5\xff\x96\x94\x94\x9b\x44\xe9\x74\xb7\x37\x57\x92\x76\xdb\x7d\xbf\x14\xfb\xf6\xa7\x37\xae\x3e\xd2\x45\x0d\xbb\xad\x78\xc2\xf7\xcb\xa3\xfe\x69\x1e\x73\x43\xc8\x72\xb7\xf9\xe6\x39\xd3\xab\x93\xea\xb4\x8f\x75\x7a\xc5\x7b\x48\xcd\x49\x40\x88\x4c\x5f\x60\x94\x50\xce\xf1\xdc\xa7\x15\x6b\x43\x87\x6a\x36\x10\xfc\x04\xf1\x16\x3f\x9c\x8f\x72\x17\xeb\x42\xfa\x10\xe9\x2f\x5c\xb3\xb3\x3c\x2e\x1d\xa0\xde\x59\xc7\x85\xf3\x49\xf5\x1a\x33\xc8\x55\xa1\xb9\xd2\xdc\xbe\xa1\x5e\x37\x6f\x3b\xdf\x6d\x97\xe0\xe6\x16\xa2\x68\xfb\x12\xb4\x3d\xff\xee\xdc\xad\xf5\x01\x00\xa8\xfc\x0c\x2e\x70\xeb\xc7\x65\x8a\xef\xdb\x23\x78\x88\xb6\x97\xa2\x8e\x07\x9f\xc3\x15\xbe\x39\x8e\x51\xa2\x39\xf1\x84\x89\x68\xda\x1a\xb6\xf0\x6d\x5a\xb7\x10\xfd\xc6\xb3\xe7\x2e\x16\x0a\x83\x15\x20\x93\x69\x1f\x75\xc9\xb4\xe4\x32\x8b\xa6\x70\x25\xd1\x01\xaa\x61\xa6\x47\x62\xfd\x8e\x29\x2f\xf3\xf0\x68\x5c\xce\x95\x0d\x65\x57\x77\xa1\x8e\x86\xb9\x53\xcb\x5e\x0c\x99\xb6\x9a\xb8\xbf\xeb\x6f\x6a\x2e\x74\xc7\xad\xab\x53\x5b\x18\x5e\xec\x51\x6a\x8d\x56\x2c\x40\xb5\xb3\x2b\x17\xa4\xde\xf9\x14\x3c\xae\x62\x5f\xc9\x63\xca\xee\x90\xfa\x57\xdd\x56\xa7\x55\xf2\x8a\xd4\x3d\x36\x3a\x79\x52\x0d\x80\x31\xc1\x99\x39\xfd\xe0\x7d\x5f\x7a\x9f\xfe\x5a\x32\x00\x7c\xf8\x73\xc9\x80\xc3\xb1\x6f\x26\x43\xc9\x7b\x1f\x4e\xfe\x0d\x00\x00\xff\xff\x74\x5d\xc4\xb5\xa5\x1f\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\x59\x4d\x6f\xf3\x36\x0c\xbe\xe7\x57\x10\x7e\x77\x68\x0e\xf5\x3b\xec\x58\xa0\x18\x5e\x0c\xfb\x38\x74\xc3\xd0\xa2\xbb\x0c\x43\xa0\xda\x8c\xab\x56\x96\x5c\x89\x4e\x1a\xa4\xf9\xef\x83\x6c\xc7\x91\xbf\x12\xd9\xcd\x4e\xcb\x2d\x51\xc8\x87\xf4\xf3\xd0\xa4\xa4\x6c\xb7\x10\xe3\x92\x4b\x84\x60\xb1\x60\x02\x35\xa5\x4c\xb2\x04\x75\x00\xbb\xdd\x37\xe7\xfb\x76\x0b\x28\x63\xd8\xed\x66\x83\x2e\x8f\xf7\x77\xd6\x6b\xbb\x85\xf0\xe7\x77\x42\x2d\x99\x78\xbc\xbf\x83\xdd\xee\xeb\x97\xaf\x85\x9d\xf9\x51\x63\x84\x7c\x85\xfa\xd6\x1a\xdd\x57\x5f\xe0\x03\x72\x2d\xde\x72\xd4\x9b\xd2\xbd\x0a\xd4\x8c\x64\xf2\xa7\x17\x8c\xc8\x46\xf8\xdb\x7a\x3f\x10\xa3\xdc\xc0\x07\x90\x7a\xcc\x32\xd4\xa5\x2b\x5f\x02\xbe\xd5\x3f\x06\x4b\xae\xb9\x4c\xac\xcf\x8d\xf5\x29\x1e\xc8\x84\xbf\x14\xab\xf0\x01\x02\xa5\x1b\xf1\x1f\xb0\x46\xbf\x6a\x95\x67\x77\xec\x09\x85\x09\x1f\x94\x26\x8c\xff\x64\x5c\x9b\xf0\x2f\x26\x72\xb4\x01\x5f\x14\x97\x10\x80\x45\x85\x32\x64\x42\x70\x65\xb1\xc2\x9f\x54\x9a\x2a\x59\x3a\xcf\xab\x35\x07\x6f\x0e\xbb\xdd\xd5\x76\x0b\x6b\x4e\xcf\x4d\xe3\xf0\x1e\x53\xb5\xc2\x66\xf4\x3f\x58\x8a\xa6\x62\xb4\x2f\x7a\x9d\xf8\xbc\xfe\x34\x20\x53\x8c\x26\xd2\x3c\x23\xae\x64\x70\x84\x63\xc2\x77\x2a\x25\x5d\x08\x6e\xa8\x32\xd5\x4c\x26\x08\x21\xec\x76\x65\x5e\x37\xb3\xc3\x62\x97\x27\xcb\xca\x75\x41\xa4\x4d\xdf\x7e\xbb\x85\xfa\x01\xaa\xc4\xca\xe0\xdf\xa4\x54\xc4\x6c\x4e\x0d\x48\x67\x79\x1a\xee\x83\xca\x75\x84\x37\xa5\x98\x28\x51\x33\x52\xba\xac\xc4\x59\x0f\x51\x47\x29\x58\xa4\x4c\xbf\xc6\x6a\x2d\x3b\x5c\xcc\x7c\xc9\xf0\xcc\x7a\x36\x9e\x0e\x5f\x64\x2f\x42\x66\xfd\x8c\x18\xc1\xa2\xd7\x30\xc6\x25\xcb\x05\x85\xc4\x49\x60\x45\x05\x61\x9a\x09\x46\xcd\x97\x33\x1c\xaa\xc1\x26\x4e\x6e\x6c\x7b\x48\xfb\xa0\x9a\x4d\xc8\x13\x6f\xc9\x84\x78\x62\xd1\x6b\x07\xaf\x37\x7d\x0b\x0a\x1f\x70\xca\x50\x70\xf9\xea\x9d\x41\x54\x65\xc0\xe3\xc0\xcf\x21\xd3\x68\x6b\xcd\xd3\xda\x49\xe8\x28\x63\x45\x0f\xf6\x4c\x99\x47\x4a\x62\xaa\x5e\x78\xe0\x6f\x9f\x6b\xe1\x9b\xb1\xff\xc3\x2d\x95\xa2\x72\xe2\xf8\x10\xad\x84\xda\xdb\x0e\x76\xfb\xd8\xbe\x3b\xc5\xcc\x12\xc6\xbe\x0c\x89\x52\x71\xdf\xab\xef\x86\xc9\x2c\x7f\x71\x4e\x9b\x3a\x54\xb7\x6b\x8e\xab\xf9\x2e\x62\x24\x38\x4a\x9a\x5e\xf5\x43\x88\x87\xd1\x3b\xad\x30\xba\xb8\x5c\x1a\x62\x32\x42\xd3\x83\xdb\x19\x13\xe1\x30\xab\x2a\x33\x09\x4a\x8e\x35\x70\x8a\xc6\xb0\x64\x5a\x13\xe9\x80\x75\x15\xaa\xa6\xea\x40\xd7\xec\x1d\xa3\xb3\xd6\x10\x6f\xec\x12\xe6\xf0\x3d\x5c\xdb\xee\x5c\x2c\x42\xb9\x58\xf4\xe7\xe3\x8c\x34\xb7\x1a\x45\x90\x6b\xe7\x89\x7a\xe2\xdd\xa3\x51\x62\x85\x71\x2b\xe2\x7e\xd9\x3f\xe6\xde\xa3\x13\xf5\xda\x87\x52\x53\x0c\x8b\xf1\xd5\xd4\x50\x7d\x8d\xd1\x33\xa3\xb1\x9a\xcf\x2e\xfa\x1d\xd1\xcf\xdd\x8d\x3f\x6a\xd1\xc1\xeb\xd5\x67\x40\xf5\x96\x3e\xa4\x16\x76\x22\x0f\x76\xe0\xae\x79\xc6\x34\x6d\x46\xd8\x13\x4b\x7c\xad\x59\x82\x92\x16\xed\x39\xda\xac\xaf\x15\x8f\x48\x69\x95\x99\x43\xd9\x12\x23\x5c\x34\x0b\xed\x52\x4b\xe3\x7a\x41\x97\x55\x94\xc4\x69\xb3\x88\xb9\xc9\x04\xdb\x2c\x06\xb6\x6c\xa7\x1b\x77\x17\x39\x55\x92\x93\xb2\x84\x2c\x48\x29\x31\x72\x24\x36\x66\x57\x6e\x9e\xd5\x0a\xf5\x19\x36\xa9\x1d\xa8\xff\xbe\x9e\xce\x53\x4e\xfe\xd5\x74\xbe\x62\xea\x9e\x1b\x8e\x31\x79\xd8\x38\x8e\x99\x29\xee\x2e\x50\x3a\x2f\xfb\xe1\x2e\x60\xfc\x41\xc4\xc1\xb9\xc8\x3b\x46\x5e\x97\x45\x42\x81\x89\x66\x69\x1f\x95\xff\x5b\x52\x62\x6e\x22\xa5\x63\xe7\xa8\x22\xe9\xb0\xdd\xef\x96\x62\xdb\x7e\x7a\xe3\x6a\x23\x5d\xd4\xb0\xdb\x8a\x27\x7c\xbf\xbc\xea\x9f\xe6\x31\x35\x84\x2c\x75\x9b\x6f\x9a\x32\xbd\x99\x54\xa7\x6d\xac\xe9\x15\xdf\x41\xaa\xae\x1b\x7c\x64\xfa\x02\xa3\x84\x72\xee\x00\x3f\xad\x58\x1d\xda\x57\xb3\x9e\xe0\x13\xc4\x5b\xfd\x70\x3e\xca\x5d\xac\x0b\xe9\x7d\xa4\xbf\x70\xcd\xce\xf2\xba\x34\x80\x5a\x77\x1d\x17\xce\x67\xc5\x31\xa6\x97\xab\x4c\x73\xa5\xb9\x3d\xa1\x5e\x57\xa7\x9d\xef\xf6\x4b\x70\x73\x0b\x41\xb0\x3f\x04\xed\x2f\xd9\x1b\x4f\x6b\x7d\x00\x00\x0a\x3f\x83\x2b\xdc\xfb\x71\x19\xe3\xfb\xfe\x9e\x1f\x82\xfd\x4f\x41\xc3\x83\x2f\xe1\x0a\xdf\x1c\xc7\x20\xd2\x9c\x78\xc4\x44\x30\xaf\x0d\x6b\xf8\x3a\xad\x5b\x08\x7e\xe3\xc9\x73\x13\xab\xb8\xbe\xb4\x80\x4c\xc6\x6d\xd4\x35\xd3\x92\xcb\x24\x98\xc3\x95\x44\x07\xa8\x84\x99\x9f\x88\xf5\x3b\xc6\x3c\x4f\xfd\xa3\x71\xb9\x54\x36\x94\x5d\x3d\x84\x3a\x19\xe6\x4e\xad\x5b\x31\x64\x5c\x6b\xe2\x7e\x2e\xaf\x72\x5d\xe8\x86\x5b\x53\xa7\xba\x30\x3a\xb1\x47\xa9\x35\x5a\x31\x0f\xd5\xce\xae\x9c\x97\x7a\xe7\x53\xf0\xb4\x8a\x6d\x25\x4f\x29\x7b\x40\x6a\xff\xea\xb6\x3a\xad\xa2\x57\xa4\xe6\xb5\xd1\xe4\x49\xd5\x03\xc6\x04\x67\x66\xfa\xc5\xfb\x50\x7a\x9f\xfe\x4b\xa6\x07\xf8\xf8\x7f\x32\x3d\x0e\xa7\xfe\x98\xe9\x4b\xbe\xf3\xef\xcc\xbf\x01\x00\x00\xff\xff\xfa\x29\x5b\x52\x0a\x20\x00\x00"), }, "/templates/email.tmpl": &vfsgen۰CompressedFileInfo{ name: "email.tmpl", diff --git a/config/notifiers.go b/config/notifiers.go index e8b7dcf28c..3c4525ca15 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -94,7 +94,7 @@ var ( NotifierConfig: NotifierConfig{ VSendResolved: false, }, - Color: `{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}`, + Color: `{{ template "slack.default.color" . }}`, Username: `{{ template "slack.default.username" . }}`, Title: `{{ template "slack.default.title" . }}`, TitleLink: `{{ template "slack.default.titlelink" . }}`, diff --git a/docs/configuration.md b/docs/configuration.md index 03c01f4a17..aa18f02fff 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1436,15 +1436,15 @@ The notification contains an [attachment](https://api.slack.com/messaging/compos channel: # API request data as defined by the Slack webhook API. -[ icon_emoji: ] -[ icon_url: ] +[ icon_emoji: | default = '{{ template "slack.default.iconemoji" . }}' ] +[ icon_url: | default = '{{ template "slack.default.iconurl" . }}' ] [ link_names: | default = false ] [ username: | default = '{{ template "slack.default.username" . }}' ] # The following parameters define the attachment. actions: [ ... ] [ callback_id: | default = '{{ template "slack.default.callbackid" . }}' ] -[ color: | default = '{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}' ] +[ color: | default = '{{ template "slack.default.color" . }}' ] [ fallback: | default = '{{ template "slack.default.fallback" . }}' ] fields: [ ... ] diff --git a/template/default.tmpl b/template/default.tmpl index 57e877c0c2..d62bb32ab3 100644 --- a/template/default.tmpl +++ b/template/default.tmpl @@ -32,6 +32,7 @@ Source: {{ .GeneratorURL }} {{ define "slack.default.iconurl" }}{{ end }} {{ define "slack.default.text" }}{{ end }} {{ define "slack.default.footer" }}{{ end }} +{{ define "slack.default.color" }}{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}{{ end }} {{ define "pagerduty.default.description" }}{{ template "__subject" . }}{{ end }}