Просмотр исходного кода

Adding Action to view the graph by its public URL.

Henrique Oliveira 7 лет назад
Родитель
Сommit
e983f8f54b
1 измененных файлов с 20 добавлено и 8 удалено
  1. 20 8
      pkg/services/alerting/notifiers/teams.go

+ 20 - 8
pkg/services/alerting/notifiers/teams.go

@@ -96,14 +96,26 @@ func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error {
 					},
 				},
 				"text": message,
-				"potentialAction": []map[string]interface{}{
-					{
-						"@context": "http://schema.org",
-						"@type":    "ViewAction",
-						"name":     "View Rule",
-						"target": []string{
-							ruleUrl,
-						},
+			},
+		},
+		"potentialAction": []map[string]interface{}{
+			{
+				"@context": "http://schema.org",
+				"@type":    "OpenUri",
+				"name":     "View Rule",
+				"targets": []map[string]interface{}{
+					{ 
+						"os": "default", "uri": ruleUrl,
+					},
+				},
+			},
+			{
+				"@context": "http://schema.org",
+				"@type":    "OpenUri",
+				"name":     "View Graph",
+				"targets": []map[string]interface{}{
+					{ 
+						"os": "default", "uri": evalContext.ImagePublicUrl,
 					},
 				},
 			},