merge upstream formatter for grafana_9x
This commit is contained in:
parent
6781f994f9
commit
6e05a2a3f9
1 changed files with 9 additions and 0 deletions
9
matrix_webhook/formatters/grafana_9x.py
Normal file
9
matrix_webhook/formatters/grafana_9x.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
def grafana_9x(data, headers):
|
||||||
|
"""Pretty-print a Grafana newer than v9.x notification."""
|
||||||
|
text = ""
|
||||||
|
if "title" in data:
|
||||||
|
text = "#### " + data["title"] + "\n"
|
||||||
|
if "message" in data:
|
||||||
|
text = text + data["message"].replace("\n", "\n\n") + "\n\n"
|
||||||
|
data["body"] = text
|
||||||
|
return data
|
Loading…
Reference in a new issue