Snapshot: use given key and deleteKey (#16876)

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
pull/16976/head
zhulongcheng 6 years ago committed by Torkel Ödegaard
parent 7b92c56055
commit 7ebbeb09cb
  1. 10
      pkg/api/dashboard_snapshot.go

@ -99,8 +99,14 @@ func CreateDashboardSnapshot(c *m.ReqContext, cmd m.CreateDashboardSnapshotComma
metrics.M_Api_Dashboard_Snapshot_External.Inc()
} else {
cmd.Key = util.GetRandomString(32)
cmd.DeleteKey = util.GetRandomString(32)
if cmd.Key == "" {
cmd.Key = util.GetRandomString(32)
}
if cmd.DeleteKey == "" {
cmd.DeleteKey = util.GetRandomString(32)
}
url = setting.ToAbsUrl("dashboard/snapshot/" + cmd.Key)
metrics.M_Api_Dashboard_Snapshot_Create.Inc()

Loading…
Cancel
Save