feat(plugins): dashboard import for data sources is working! #4298

This commit is contained in:
Torkel Ödegaard
2016-03-12 10:13:49 +01:00
parent 3fb0b71822
commit 0398face05
18 changed files with 278 additions and 80 deletions
+9 -5
View File
@@ -1,6 +1,10 @@
package models
import "time"
import (
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
)
// DashboardSnapshot model
type DashboardSnapshot struct {
@@ -17,7 +21,7 @@ type DashboardSnapshot struct {
Created time.Time
Updated time.Time
Dashboard map[string]interface{}
Dashboard *simplejson.Json
}
// DashboardSnapshotDTO without dashboard map
@@ -40,9 +44,9 @@ type DashboardSnapshotDTO struct {
// COMMANDS
type CreateDashboardSnapshotCommand struct {
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
Name string `json:"name" binding:"Required"`
Expires int64 `json:"expires"`
Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
Name string `json:"name" binding:"Required"`
Expires int64 `json:"expires"`
// these are passed when storing an external snapshot ref
External bool `json:"external"`