Commit 7ebbeb09 by zhulongcheng Committed by Torkel Ödegaard

Snapshot: use given key and deleteKey (#16876)

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
parent 7b92c560
...@@ -99,8 +99,14 @@ func CreateDashboardSnapshot(c *m.ReqContext, cmd m.CreateDashboardSnapshotComma ...@@ -99,8 +99,14 @@ func CreateDashboardSnapshot(c *m.ReqContext, cmd m.CreateDashboardSnapshotComma
metrics.M_Api_Dashboard_Snapshot_External.Inc() metrics.M_Api_Dashboard_Snapshot_External.Inc()
} else { } else {
cmd.Key = util.GetRandomString(32) if cmd.Key == "" {
cmd.DeleteKey = util.GetRandomString(32) cmd.Key = util.GetRandomString(32)
}
if cmd.DeleteKey == "" {
cmd.DeleteKey = util.GetRandomString(32)
}
url = setting.ToAbsUrl("dashboard/snapshot/" + cmd.Key) url = setting.ToAbsUrl("dashboard/snapshot/" + cmd.Key)
metrics.M_Api_Dashboard_Snapshot_Create.Inc() metrics.M_Api_Dashboard_Snapshot_Create.Inc()
......
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