mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:32:13 +08:00
Fix unwanted newlines in plain text email (#70141)
This commit is contained in:
@ -18,8 +18,8 @@ Go to the Alerts page: [[ .AlertPageUrl ]]
|
||||
[[- define "__default_alerts_summarize" -]]
|
||||
[[- range . ]]
|
||||
[[ template "__default_alert_labels" . ]]
|
||||
[[ template "__default_alert_annotations" . ]]
|
||||
[[- end ]]
|
||||
[[- template "__default_alert_annotations" . ]]
|
||||
[[ end ]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_alert_labels" -]]
|
||||
@ -32,21 +32,21 @@ Labels: [[ .Labels.SortedPairs ]]
|
||||
|
||||
[[- define "__default_alert_annotations" -]]
|
||||
[[- $annotations := .Annotations -]]
|
||||
[[- if index $annotations "summary" -]]
|
||||
Summary: [[ index .Annotations "summary" ]]
|
||||
[[- if index $annotations "summary" ]]
|
||||
Summary: [[ index .Annotations "summary" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "summary")) ]]
|
||||
[[ end -]]
|
||||
[[- if index $annotations "description" -]]
|
||||
Description: [[ index $annotations "description" ]]
|
||||
[[- end -]]
|
||||
[[- if index $annotations "description" ]]
|
||||
Description: [[ index $annotations "description" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "description")) ]]
|
||||
[[ end -]]
|
||||
[[- if index $annotations "runbook_url" -]]
|
||||
Runbook: [[ index $annotations "runbook_url" ]]
|
||||
[[- end -]]
|
||||
[[- if index $annotations "runbook_url" ]]
|
||||
Runbook: [[ index $annotations "runbook_url" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "runbook_url")) ]]
|
||||
[[ end -]]
|
||||
[[- if $annotations -]]
|
||||
[[- end -]]
|
||||
[[- if $annotations ]]
|
||||
Annotations: [[ template "__default_sorted_pairs" $annotations ]]
|
||||
[[ end -]]
|
||||
[[- end -]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_sorted_pairs" -]]
|
||||
|
@ -18,8 +18,8 @@ Go to the Alerts page: {{ .AlertPageUrl }}
|
||||
{{- define "__default_alerts_summarize" -}}
|
||||
{{- range . }}
|
||||
{{ template "__default_alert_labels" . }}
|
||||
{{ template "__default_alert_annotations" . }}
|
||||
{{- end }}
|
||||
{{- template "__default_alert_annotations" . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "__default_alert_labels" -}}
|
||||
@ -32,21 +32,21 @@ Labels: {{ .Labels.SortedPairs }}
|
||||
|
||||
{{- define "__default_alert_annotations" -}}
|
||||
{{- $annotations := .Annotations -}}
|
||||
{{- if index $annotations "summary" -}}
|
||||
Summary: {{ index .Annotations "summary" }}
|
||||
{{- if index $annotations "summary" }}
|
||||
Summary: {{ index .Annotations "summary" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "summary")) }}
|
||||
{{ end -}}
|
||||
{{- if index $annotations "description" -}}
|
||||
Description: {{ index $annotations "description" }}
|
||||
{{- end -}}
|
||||
{{- if index $annotations "description" }}
|
||||
Description: {{ index $annotations "description" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "description")) }}
|
||||
{{ end -}}
|
||||
{{- if index $annotations "runbook_url" -}}
|
||||
Runbook: {{ index $annotations "runbook_url" }}
|
||||
{{- end -}}
|
||||
{{- if index $annotations "runbook_url" }}
|
||||
Runbook: {{ index $annotations "runbook_url" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "runbook_url")) }}
|
||||
{{ end -}}
|
||||
{{- if $annotations -}}
|
||||
{{- end -}}
|
||||
{{- if $annotations }}
|
||||
Annotations: {{ template "__default_sorted_pairs" $annotations }}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "__default_sorted_pairs" -}}
|
||||
|
Reference in New Issue
Block a user