Skip to content

Commit

Permalink
Update alert email to display severity icon correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Dec 17, 2024
1 parent 2edde00 commit cab2ed8
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions ui/public/brand/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@
align="center"
class="links-color"
>
<!--[if (lte ie 8)]><div style="display: inline-block; width: 258px; -mru-width: 0px"><![endif]-->
<!--[if (lte ie 8)]><div style="display: inline-block; width: 258px; -mru-width: 0px"><!
[endif]-->
<!--[if (lte ie 8)]></div><![endif]-->
</td>
</tr>
Expand Down Expand Up @@ -338,10 +339,7 @@
"
>
<span style="font-weight: normal">
{{ .Alerts | len }} alert{{ if gt (len
.Alerts) 1 }}s{{ end }} for {{ range
.GroupLabels.SortedPairs }} {{ .Name }}={{
.Value }} {{ end }}</span
{{ .Alerts | len }} alert{{ if gt (len .Alerts) 1 }}s{{ end }} for {{ range .GroupLabels.SortedPairs }} {{ .Name }}={{ .Value }} {{ end }}</span
>
</td>
</tr>
Expand Down Expand Up @@ -526,8 +524,7 @@
"
>
<span style="font-weight: normal"
>{{ .Alerts.Firing | len }} Alert{{ if gt
(len .Alerts.Firing) 1 }}s{{ end }}
>{{ .Alerts.Firing | len }} Alert{{ if gt (len .Alerts.Firing) 1 }}s{{ end }}
currently firing</span
>
</td>
Expand Down Expand Up @@ -615,29 +612,18 @@
<tr>
<td>
{{ if eq .Labels.severity "critical" }}
<img
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtdGltZXMtY2lyY2xlIGZhLXctMTYgZmEtMXggc2MtSFVyclcgZ2duVWxGIiB3aWR0aD0iMjQiIGNvbG9yPSIjRDY1NDVBIiBhcmlhLWhpZGRlbj0idHJ1ZSIgYXJpYS1sYWJlbD0iVGltZXMtY2lyY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XRpb24tY2lyY2xlIHN0YXR1cyB3YXJuaW5nIiBkYXRhLWljb249ImV4Y2xhbWF0aW9uLWNpcmNsZSIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0ibTUwNCAyNTZjMCAxMzctMTExLjA0IDI0OC0yNDggMjQ4cy0yNDgtMTExLTI0OC0yNDhjMC0xMzYuOTIgMTExLjA0LTI0OCAyNDgtMjQ4czI0OCAxMTEuMDggMjQ4IDI0OHptLTI0OCA1MGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNSA3LjQxOCAxMzZjMC4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2YzAuMzc1LTYuODc0LTUuMDk4LTEyLjY1NC0xMS45ODItMTIuNjU0aC02My4zODNjLTYuODg0IDAtMTIuMzU2IDUuNzgtMTEuOTgxIDEyLjY1NHoiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K" /> (warning)
{{ else }} {{ .Labels.severity }} {{ end }}
</td>
<td>{{ .Labels.alertname }}</td>
<td>
{{if .Annotations.description }} {{
.Annotations.description }} {{ else if
.Annotations.message }} {{ .Annotations.message
}} {{ else if .Annotations.summary }} {{
.Annotations.summary }} {{ else }} No
{{if .Annotations.description }} {{ .Annotations.description }} {{ else if .Annotations.message }} {{ .Annotations.message }} {{ else if .Annotations.summary }} {{ .Annotations.summary }} {{ else }} No
description {{ end }}
</td>
<td>
{{ .StartsAt.Format "2006-01-02 15:04:05
(Z07:00)" }}
{{ .StartsAt.Format "2006-01-02 15:04:05 (Z07:00)" }}
</td>
</tr>
{{ end }}
Expand Down Expand Up @@ -862,8 +848,7 @@
"
>
<span style="font-weight: normal"
>{{ .Alerts.Resolved | len }} Alert{{ if gt
(len .Alerts.Resolved) 1 }}s{{ end }}
>{{ .Alerts.Resolved | len }} Alert{{ if gt (len .Alerts.Resolved) 1 }}s{{ end }}
resolved</span
>
</td>
Expand Down Expand Up @@ -955,24 +940,16 @@
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtdGltZXMtY2lyY2xlIGZhLXctMTYgZmEtMXggc2MtSFVyclcgZ2duVWxGIiB3aWR0aD0iMjQiIGNvbG9yPSIjRDY1NDVBIiBhcmlhLWhpZGRlbj0idHJ1ZSIgYXJpYS1sYWJlbD0iVGltZXMtY2lyY2xlIHN0YXR1cyBjcml0aWNhbCIgZGF0YS1pY29uPSJ0aW1lcy1jaXJjbGUiIGRhdGEtcHJlZml4PSJmYXMiIGZvY3VzYWJsZT0iZmFsc2UiIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0yNTYgOEMxMTkgOCA4IDExOSA4IDI1NnMxMTEgMjQ4IDI0OCAyNDggMjQ4LTExMSAyNDgtMjQ4UzM5MyA4IDI1NiA4em0xMjEuNiAzMTMuMWM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzM4IDM3Ny42Yy00LjcgNC43LTEyLjMgNC43LTE3IDBMMjU2IDMxMmwtNjUuMSA2NS42Yy00LjcgNC43LTEyLjMgNC43LTE3IDBMMTM0LjQgMzM4Yy00LjctNC43LTQuNy0xMi4zIDAtMTdsNjUuNi02NS02NS42LTY1LjFjLTQuN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EuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2YzAuMzc1LTYuODc0LTUuMDk4LTEyLjY1NC0xMS45ODItMTIuNjU0aC02My4zODNjLTYuODg0IDAtMTIuMzU2IDUuNzgtMTEuOTgxIDEyLjY1NHoiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K" />
{{ else }} {{ .Labels.severity }} {{ end }}
</td>
<td>{{ .Labels.alertname }}</td>
<td>
{{if .Annotations.description }} {{
.Annotations.description }} {{ else if
.Annotations.message }} {{ .Annotations.message
}} {{ else if .Annotations.summary }} {{
.Annotations.summary }} {{ else }} No
{{if .Annotations.description }} {{ .Annotations.description }} {{ else if .Annotations.message }} {{ .Annotations.message }} {{ else if .Annotations.summary }} {{ .Annotations.summary }} {{ else }} No
description {{ end }}
</td>
<td>
{{ .StartsAt.Format "2006-01-02 15:04:05
(Z07:00)" }} - {{ .EndsAt.Format "2006-01-02
15:04:05 (Z07:00)" }}
{{ .StartsAt.Format "2006-01-02 15:04:05 (Z07:00)" }} - {{ .EndsAt.Format "2006-01-02 15:04:05 (Z07:00)" }}
</td>
</tr>
{{ end }}
Expand All @@ -994,4 +971,4 @@
<!--[if !(gte mso 16)]-->
</body>
<!--<![endif]-->
</html>
</html>

0 comments on commit cab2ed8

Please sign in to comment.