mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
bd010289b2
its now possible to turn of image uploading in alert notifications for those who operate on very sensitive data. closes #7419
47 lines
922 B
Go
47 lines
922 B
Go
package notifiers
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
|
"github.com/grafana/grafana/pkg/services/alerting"
|
|
)
|
|
|
|
type NotifierBase struct {
|
|
Name string
|
|
Type string
|
|
Id int64
|
|
IsDeault bool
|
|
UploadImage bool
|
|
}
|
|
|
|
func NewNotifierBase(id int64, isDefault bool, name, notifierType string, model *simplejson.Json) NotifierBase {
|
|
uploadImage := model.Get("uploadImage").MustBool(true)
|
|
|
|
return NotifierBase{
|
|
Id: id,
|
|
Name: name,
|
|
IsDeault: isDefault,
|
|
Type: notifierType,
|
|
UploadImage: uploadImage,
|
|
}
|
|
}
|
|
|
|
func (n *NotifierBase) PassesFilter(rule *alerting.Rule) bool {
|
|
return true
|
|
}
|
|
|
|
func (n *NotifierBase) GetType() string {
|
|
return n.Type
|
|
}
|
|
|
|
func (n *NotifierBase) NeedsImage() bool {
|
|
return n.UploadImage
|
|
}
|
|
|
|
func (n *NotifierBase) GetNotifierId() int64 {
|
|
return n.Id
|
|
}
|
|
|
|
func (n *NotifierBase) GetIsDefault() bool {
|
|
return n.IsDeault
|
|
}
|