Explorar el Código

Add thumbnail to card

Joseph Weigl hace 8 años
padre
commit
81d3ab37c3
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      pkg/services/alerting/notifiers/hipchat.go

+ 8 - 0
pkg/services/alerting/notifiers/hipchat.go

@@ -134,6 +134,14 @@ func (this *HipChatNotifier) Notify(evalContext *alerting.EvalContext) error {
 		"date":       evalContext.EndTime.Unix(),
 		"date":       evalContext.EndTime.Unix(),
 		"attributes": attributes,
 		"attributes": attributes,
 	}
 	}
+	if len(evalContext.ImagePublicUrl) > 0 {
+		card["thumbnail"] = map[string]interface{}{
+			"url":    evalContext.ImagePublicUrl,
+			"url@2x": evalContext.ImagePublicUrl,
+			"width":  1193,
+			"height": 564,
+		}
+	}
 
 
 	body := map[string]interface{}{
 	body := map[string]interface{}{
 		"message":        message,
 		"message":        message,