瀏覽代碼

Handle message-less Grafana alerts

master
JustAnotherArchivist 3 年之前
父節點
當前提交
c2803274d1
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      contrib/modules/grafana.py

+ 4
- 1
contrib/modules/grafana.py 查看文件

@@ -3,4 +3,7 @@ import json

async def process(request):
obj = json.loads(await request.text())
return f'{obj["title"]} - {obj["message"]}'
if 'message' in obj:
return f'{obj["title"]} - {obj["message"]}'
else:
return obj['title']

Loading…
取消
儲存