mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 18:01:40 -06:00
fix(snapshots): sets default value for snapshot name
make it possible for < 3.0 instances to publish snapshots ref #4778
This commit is contained in:
parent
7079b5d770
commit
51de894692
@ -21,6 +21,10 @@ func GetSharingOptions(c *middleware.Context) {
|
||||
}
|
||||
|
||||
func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapshotCommand) {
|
||||
if cmd.Name == "" {
|
||||
cmd.Name = "Unnamed snapshot"
|
||||
}
|
||||
|
||||
if cmd.External {
|
||||
// external snapshot ref requires key and delete key
|
||||
if cmd.Key == "" || cmd.DeleteKey == "" {
|
||||
|
@ -45,7 +45,7 @@ type DashboardSnapshotDTO struct {
|
||||
|
||||
type CreateDashboardSnapshotCommand struct {
|
||||
Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Name string `json:"name"`
|
||||
Expires int64 `json:"expires"`
|
||||
|
||||
// these are passed when storing an external snapshot ref
|
||||
|
Loading…
Reference in New Issue
Block a user