diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index dddb5ed436a..8eb9da60231 100644 --- a/pkg/api/dashboard_snapshot.go +++ b/pkg/api/dashboard_snapshot.go @@ -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) } diff --git a/pkg/models/dashboard_snapshot.go b/pkg/models/dashboard_snapshot.go index c9221f42815..65163e6b119 100644 --- a/pkg/models/dashboard_snapshot.go +++ b/pkg/models/dashboard_snapshot.go @@ -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 diff --git a/pkg/services/sqlstore/dashboard_snapshot.go b/pkg/services/sqlstore/dashboard_snapshot.go index 64e7e31898c..b7ffa0b9912 100644 --- a/pkg/services/sqlstore/dashboard_snapshot.go +++ b/pkg/services/sqlstore/dashboard_snapshot.go @@ -25,6 +25,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error { } snapshot := &m.DashboardSnapshot{ + Name: cmd.Name, Key: cmd.Key, DeleteKey: cmd.DeleteKey, OrgId: cmd.OrgId, diff --git a/public/app/features/apps/edit_ctrl.ts b/public/app/features/apps/edit_ctrl.ts index 2cbeb4a2ae1..d793f045690 100644 --- a/public/app/features/apps/edit_ctrl.ts +++ b/public/app/features/apps/edit_ctrl.ts @@ -7,10 +7,9 @@ export class AppEditCtrl { appModel: any; /** @ngInject */ - constructor(private backendSrv: any, private $routeParams: any) {} - - init() { + constructor(private backendSrv: any, private $routeParams: any) { this.appModel = {}; + this.backendSrv.get(`/api/org/apps/${this.$routeParams.appId}/settings`).then(result => { this.appModel = result; }); diff --git a/public/app/features/apps/partials/edit.html b/public/app/features/apps/partials/edit.html index fc09dc4754c..4de73a25901 100644 --- a/public/app/features/apps/partials/edit.html +++ b/public/app/features/apps/partials/edit.html @@ -5,99 +5,99 @@
-
-