mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
Merge pull request #3789 from utkarshcmu/snap-bug
Snapshot name is saved in DB now Fixes #3768
This commit is contained in:
commit
db1ba30df7
@ -36,6 +36,7 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
|
||||
cmd.DeleteKey = util.GetRandomString(32)
|
||||
cmd.OrgId = c.OrgId
|
||||
cmd.UserId = c.UserId
|
||||
cmd.Name = c.Name
|
||||
metrics.M_Api_Dashboard_Snapshot_Create.Inc(1)
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ type DashboardSnapshot struct {
|
||||
|
||||
type CreateDashboardSnapshotCommand struct {
|
||||
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Expires int64 `json:"expires"`
|
||||
|
||||
// these are passed when storing an external snapshot ref
|
||||
|
@ -24,6 +24,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error {
|
||||
}
|
||||
|
||||
snapshot := &m.DashboardSnapshot{
|
||||
Name: cmd.Name,
|
||||
Key: cmd.Key,
|
||||
DeleteKey: cmd.DeleteKey,
|
||||
OrgId: cmd.OrgId,
|
||||
|
@ -60,6 +60,7 @@ function (angular, _) {
|
||||
|
||||
var cmdData = {
|
||||
dashboard: dash,
|
||||
name: dash.title,
|
||||
expires: $scope.snapshot.expires,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user