From 70481953fd067f9aaedd2a17b3b74d153640cac2 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Tue, 19 Jan 2016 00:26:20 -0800 Subject: [PATCH 1/3] Snapshot name is saved in DB now --- pkg/api/dashboard_snapshot.go | 1 + pkg/models/dashboard_snapshot.go | 5 +++-- pkg/services/sqlstore/dashboard_snapshot.go | 1 + public/app/features/dashboard/shareSnapshotCtrl.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index 521dee29a63..33e6014ec46 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 e8f37e2a236..a9e85625c7c 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 @@ -32,8 +33,8 @@ type CreateDashboardSnapshotCommand struct { Key string `json:"key"` DeleteKey string `json:"deleteKey"` - OrgId int64 `json:"-"` - UserId int64 `json:"-"` + OrgId int64 `json:"-"` + UserId int64 `json:"-"` Result *DashboardSnapshot } diff --git a/pkg/services/sqlstore/dashboard_snapshot.go b/pkg/services/sqlstore/dashboard_snapshot.go index f4611050a77..5a0e1a740c4 100644 --- a/pkg/services/sqlstore/dashboard_snapshot.go +++ b/pkg/services/sqlstore/dashboard_snapshot.go @@ -24,6 +24,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/dashboard/shareSnapshotCtrl.js b/public/app/features/dashboard/shareSnapshotCtrl.js index 445677d5a12..44c2b3974a6 100644 --- a/public/app/features/dashboard/shareSnapshotCtrl.js +++ b/public/app/features/dashboard/shareSnapshotCtrl.js @@ -60,6 +60,7 @@ function (angular, _) { var cmdData = { dashboard: dash, + name: dash.title, expires: $scope.snapshot.expires, }; From 1952ebf7c4bfb01b0eed619f4e684cf75d143d26 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Tue, 19 Jan 2016 00:33:30 -0800 Subject: [PATCH 2/3] Fixed failing gofmt tests --- pkg/api/dashboard_snapshot.go | 2 +- pkg/models/dashboard_snapshot.go | 6 +++--- pkg/services/sqlstore/dashboard_snapshot.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index 33e6014ec46..f2aee67205c 100644 --- a/pkg/api/dashboard_snapshot.go +++ b/pkg/api/dashboard_snapshot.go @@ -36,7 +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 + 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 a9e85625c7c..cc563646833 100644 --- a/pkg/models/dashboard_snapshot.go +++ b/pkg/models/dashboard_snapshot.go @@ -25,7 +25,7 @@ type DashboardSnapshot struct { type CreateDashboardSnapshotCommand struct { Dashboard map[string]interface{} `json:"dashboard" binding:"Required"` - Name string `json:"name" binding:"Required"` + Name string `json:"name" binding:"Required"` Expires int64 `json:"expires"` // these are passed when storing an external snapshot ref @@ -33,8 +33,8 @@ type CreateDashboardSnapshotCommand struct { Key string `json:"key"` DeleteKey string `json:"deleteKey"` - OrgId int64 `json:"-"` - UserId int64 `json:"-"` + OrgId int64 `json:"-"` + UserId int64 `json:"-"` Result *DashboardSnapshot } diff --git a/pkg/services/sqlstore/dashboard_snapshot.go b/pkg/services/sqlstore/dashboard_snapshot.go index 5a0e1a740c4..dc8862f2d57 100644 --- a/pkg/services/sqlstore/dashboard_snapshot.go +++ b/pkg/services/sqlstore/dashboard_snapshot.go @@ -24,7 +24,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error { } snapshot := &m.DashboardSnapshot{ - Name: cmd.Name, + Name: cmd.Name, Key: cmd.Key, DeleteKey: cmd.DeleteKey, OrgId: cmd.OrgId, From 6b85a6fd78ad2b95944fca4c51e132bdbdf60a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 19 Jan 2016 11:54:35 +0100 Subject: [PATCH 3/3] feat(apps): minor design update for apps view --- public/app/features/apps/edit_ctrl.ts | 5 +- public/app/features/apps/partials/edit.html | 180 ++++++++++---------- public/less/apps.less | 24 +-- public/less/simple-box.less | 4 + 4 files changed, 108 insertions(+), 105 deletions(-) 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 @@
-
-