feat(annotations): added support to show grafana stored annotations in graphs, #5982

This commit is contained in:
Torkel Ödegaard
2016-09-08 11:25:45 +02:00
parent c769148701
commit d60bd77658
21 changed files with 246 additions and 178 deletions
+14 -16
View File
@@ -1,10 +1,6 @@
package annotations
import (
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
)
import "github.com/grafana/grafana/pkg/components/simplejson"
type Repository interface {
Save(item *Item) error
@@ -13,6 +9,8 @@ type Repository interface {
type ItemQuery struct {
OrgId int64 `json:"orgId"`
From int64 `json:"from"`
To int64 `json:"from"`
Type ItemType `json:"type"`
AlertId int64 `json:"alertId"`
@@ -36,17 +34,17 @@ const (
)
type Item struct {
Id int64 `json:"id"`
OrgId int64 `json:"orgId"`
Type ItemType `json:"type"`
Title string `json:"title"`
Text string `json:"text"`
Metric string `json:"metric"`
AlertId int64 `json:"alertId"`
UserId int64 `json:"userId"`
PrevState string `json:"prevState"`
NewState string `json:"newState"`
Timestamp time.Time `json:"timestamp"`
Id int64 `json:"id"`
OrgId int64 `json:"orgId"`
Type ItemType `json:"type"`
Title string `json:"title"`
Text string `json:"text"`
Metric string `json:"metric"`
AlertId int64 `json:"alertId"`
UserId int64 `json:"userId"`
PrevState string `json:"prevState"`
NewState string `json:"newState"`
Epoch int64 `json:"epoch"`
Data *simplejson.Json `json:"data"`
}