Snapshot: use given key and deleteKey (#16876)

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
This commit is contained in:
zhulongcheng 2019-05-09 17:53:04 +08:00 committed by Torkel Ödegaard
parent 7b92c56055
commit 7ebbeb09cb

View File

@ -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()