diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index aa20c4b8a7f..8bb6c6e6df3 100644 --- a/pkg/api/dashboard_snapshot.go +++ b/pkg/api/dashboard_snapshot.go @@ -9,7 +9,7 @@ import ( ) func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapshotCommand) { - cmd.Key = util.GetRandomString(20) + cmd.Key = util.GetRandomString(32) if err := bus.Dispatch(&cmd); err != nil { c.JsonApiErr(500, "Failed to create snaphost", err) diff --git a/src/app/features/dashboard/partials/shareDashboard.html b/src/app/features/dashboard/partials/shareDashboard.html index bfe126b390f..320042b64bf 100644 --- a/src/app/features/dashboard/partials/shareDashboard.html +++ b/src/app/features/dashboard/partials/shareDashboard.html @@ -50,36 +50,33 @@

- Create dashboard with embedded data and share with anyone + Snapshot dashboard & visible data and share with anyone

-
- -
-
-
    -
  • - Snapshot name -
  • -
  • - -
  • -
-
-
+
+
+
    +
  • + Snapshot name +
  • +
  • + +
  • +
+
+
-
- +
+
+ +
+
+
diff --git a/src/app/features/dashboard/shareSnapshotCtrl.js b/src/app/features/dashboard/shareSnapshotCtrl.js index fc7973a676c..c9a71f4230b 100644 --- a/src/app/features/dashboard/shareSnapshotCtrl.js +++ b/src/app/features/dashboard/shareSnapshotCtrl.js @@ -6,7 +6,7 @@ function (angular) { var module = angular.module('grafana.controllers'); - module.controller('ShareSnapshotCtrl', function($scope, $rootScope, $location, backendSrv, $timeout) { + module.controller('ShareSnapshotCtrl', function($scope, $rootScope, $location, backendSrv, $timeout, timeSrv) { $scope.snapshot = { name: $scope.dashboard.title @@ -24,8 +24,11 @@ function (angular) { $scope.saveSnapshot = function(makePublic) { var dash = angular.copy($scope.dashboard); + // change title dash.title = $scope.snapshot.name; - + // make relative times absolute + dash.time = timeSrv.timeRange(); + // remove panel queries & links dash.forEachPanel(function(panel) { panel.targets = []; panel.links = []; diff --git a/src/css/less/gfbox.less b/src/css/less/gfbox.less index 995ccb5b435..50401e21c50 100644 --- a/src/css/less/gfbox.less +++ b/src/css/less/gfbox.less @@ -97,20 +97,4 @@ } } -.share-snapshot { - text-align: center; - .share-snapshot-header { - .fa { - position: absolute; - font-size: 600%; - left: 41%; - color: @grafanaTargetFuncBackground; - z-index: -1; - } - - position: relative; - z-index: 1000; - line-height: 106px; - } -} diff --git a/src/css/less/grafana.less b/src/css/less/grafana.less index 579415f17f8..6b6e17ce834 100644 --- a/src/css/less/grafana.less +++ b/src/css/less/grafana.less @@ -294,3 +294,30 @@ } } } + +.share-snapshot { + text-align: center; + + .share-snapshot-header { + .fa { + position: absolute; + font-size: 600%; + left: 42%; + color: @grafanaTargetFuncBackground; + z-index: -1; + } + + position: relative; + z-index: 1000; + line-height: 106px; + margin: 45px 0 22px 0; + } + + .share-snapshot-link { + max-width: 716px; + white-space: nowrap; + overflow: hidden; + display: block; + text-overflow: ellipsis; + } +}