diff --git a/pkg/api/alerting.go b/pkg/api/alerting.go index 869fb726410..6f59527fec9 100644 --- a/pkg/api/alerting.go +++ b/pkg/api/alerting.go @@ -166,7 +166,19 @@ func GetAlertNotifications(c *middleware.Context) Response { return ApiError(500, "Failed to get alert notifications", err) } - return Json(200, query.Result) + var result []dtos.AlertNotificationDTO + + for _, notification := range query.Result { + result = append(result, dtos.AlertNotificationDTO{ + Id: notification.Id, + Name: notification.Name, + Type: notification.Type, + Created: notification.Created, + Updated: notification.Updated, + }) + } + + return Json(200, result) } func GetAlertNotificationById(c *middleware.Context) Response { diff --git a/pkg/api/api.go b/pkg/api/api.go index f1ef2427cf2..862ef3e36a1 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -263,7 +263,7 @@ func Register(r *macaron.Macaron) { r.Delete("/:notificationId", wrap(DeleteAlertNotification)) }) - r.Get("/changes", wrap(GetAlertChanges)) + //r.Get("/changes", wrap(GetAlertChanges)) }) // error test diff --git a/pkg/api/dtos/alerting.go b/pkg/api/dtos/alerting.go index 2db3878f7e9..b07ea9cd8b2 100644 --- a/pkg/api/dtos/alerting.go +++ b/pkg/api/dtos/alerting.go @@ -1,5 +1,7 @@ package dtos +import "time" + type AlertRuleDTO struct { Id int64 `json:"id"` DashboardId int64 `json:"dashboardId"` @@ -19,3 +21,11 @@ type AlertRuleDTO struct { DashbboardUri string `json:"dashboardUri"` } + +type AlertNotificationDTO struct { + Id int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Created time.Time `json:"created"` + Updated time.Time `json:"updated"` +} diff --git a/public/app/plugins/panel/graph/partials/tab_alerting.html b/public/app/plugins/panel/graph/partials/tab_alerting.html index 3cbc6042a88..7efc1d1c6c0 100644 --- a/public/app/plugins/panel/graph/partials/tab_alerting.html +++ b/public/app/plugins/panel/graph/partials/tab_alerting.html @@ -109,8 +109,11 @@
Groups + +