Commit 70481953 by utkarshcmu

Snapshot name is saved in DB now

parent 870775e8
...@@ -36,6 +36,7 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho ...@@ -36,6 +36,7 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
cmd.DeleteKey = util.GetRandomString(32) cmd.DeleteKey = util.GetRandomString(32)
cmd.OrgId = c.OrgId cmd.OrgId = c.OrgId
cmd.UserId = c.UserId cmd.UserId = c.UserId
cmd.Name = c.Name
metrics.M_Api_Dashboard_Snapshot_Create.Inc(1) metrics.M_Api_Dashboard_Snapshot_Create.Inc(1)
} }
......
...@@ -25,6 +25,7 @@ type DashboardSnapshot struct { ...@@ -25,6 +25,7 @@ type DashboardSnapshot struct {
type CreateDashboardSnapshotCommand struct { type CreateDashboardSnapshotCommand struct {
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"` Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
Name string `json:"name" binding:"Required"`
Expires int64 `json:"expires"` Expires int64 `json:"expires"`
// these are passed when storing an external snapshot ref // these are passed when storing an external snapshot ref
...@@ -32,8 +33,8 @@ type CreateDashboardSnapshotCommand struct { ...@@ -32,8 +33,8 @@ type CreateDashboardSnapshotCommand struct {
Key string `json:"key"` Key string `json:"key"`
DeleteKey string `json:"deleteKey"` DeleteKey string `json:"deleteKey"`
OrgId int64 `json:"-"` OrgId int64 `json:"-"`
UserId int64 `json:"-"` UserId int64 `json:"-"`
Result *DashboardSnapshot Result *DashboardSnapshot
} }
......
...@@ -24,6 +24,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error { ...@@ -24,6 +24,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error {
} }
snapshot := &m.DashboardSnapshot{ snapshot := &m.DashboardSnapshot{
Name: cmd.Name,
Key: cmd.Key, Key: cmd.Key,
DeleteKey: cmd.DeleteKey, DeleteKey: cmd.DeleteKey,
OrgId: cmd.OrgId, OrgId: cmd.OrgId,
......
...@@ -60,6 +60,7 @@ function (angular, _) { ...@@ -60,6 +60,7 @@ function (angular, _) {
var cmdData = { var cmdData = {
dashboard: dash, dashboard: dash,
name: dash.title,
expires: $scope.snapshot.expires, expires: $scope.snapshot.expires,
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment