diff --git a/CHANGELOG.md b/CHANGELOG.md
index eb1ffcdecb9..15e1527ad8c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# 2.0.0 (unreleased)
**New features**
+- [Issue #1622](https://github.com/grafana/grafana/issues/1622). Share Panel: The share modal now has an embed option, gives you an iframe that you can use to embedd a single graph on another web site
- [Issue #718](https://github.com/grafana/grafana/issues/718). Dashboard: When saving a dashboard and another user has made changes inbetween the user is promted with a warning if he really wants to overwrite the other's changes
- [Issue #1331](https://github.com/grafana/grafana/issues/1331). Graph & Singlestat: New axis/unit format selector and more units (kbytes, Joule, Watt, eV), and new design for graph axis & grid tab and single stat options tab views
- [Issue #1241](https://github.com/grafana/grafana/issues/1242). Timepicker: New option in timepicker (under dashboard settings), to change ``now`` to be for example ``now-1m``, usefull when you want to ignore last minute because it contains incomplete data
diff --git a/src/app/features/dashboard/dashboardNavCtrl.js b/src/app/features/dashboard/dashboardNavCtrl.js
index 9a8042cd680..17bdfb5efc7 100644
--- a/src/app/features/dashboard/dashboardNavCtrl.js
+++ b/src/app/features/dashboard/dashboardNavCtrl.js
@@ -42,7 +42,7 @@ function (angular, _, moment) {
$scope.shareDashboard = function() {
$scope.appEvent('show-modal', {
- src: './app/features/dashboard/partials/shareModal.html',
+ src: './app/features/dashboard/partials/shareDashboard.html',
scope: $scope.$new(),
});
};
diff --git a/src/app/features/dashboard/partials/shareDashboard.html b/src/app/features/dashboard/partials/shareDashboard.html
new file mode 100644
index 00000000000..e052c5b298f
--- /dev/null
+++ b/src/app/features/dashboard/partials/shareDashboard.html
@@ -0,0 +1,48 @@
+
-
-
-
diff --git a/src/app/features/dashboard/partials/sharePanel.html b/src/app/features/dashboard/partials/sharePanel.html
new file mode 100644
index 00000000000..e56fe89be59
--- /dev/null
+++ b/src/app/features/dashboard/partials/sharePanel.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
IFrame embedding
+
The html code below can be pasted and included in another web page. Unless anonymous access
+ is enabled the user viewing that page need to be signed into grafana for the graph to load.
+
+
+
+
+
diff --git a/src/app/features/dashboard/sharePanelCtrl.js b/src/app/features/dashboard/sharePanelCtrl.js
index eca10678806..40c7ba45a90 100644
--- a/src/app/features/dashboard/sharePanelCtrl.js
+++ b/src/app/features/dashboard/sharePanelCtrl.js
@@ -72,8 +72,11 @@ function (angular, _, require, config) {
});
$scope.shareUrl = baseUrl + "?" + paramsArray.join('&');
- $scope.imageUrl = $scope.shareUrl.replace('/dashboard/db/', '/render/dashboard/solo/');
+ $scope.soloUrl = $scope.shareUrl.replace('/dashboard/db/', '/dashboard/solo/');
+ $scope.iframeHtml = '
';
+
+ $scope.imageUrl = $scope.shareUrl.replace('/dashboard/db/', '/render/dashboard/solo/');
$scope.imageUrl += '&width=1000';
$scope.imageUrl += '&height=500';
};
diff --git a/src/app/features/panel/panelSrv.js b/src/app/features/panel/panelSrv.js
index ec3373c3426..7ce3d69b376 100644
--- a/src/app/features/panel/panelSrv.js
+++ b/src/app/features/panel/panelSrv.js
@@ -26,7 +26,7 @@ function (angular, _, config) {
$scope.sharePanel = function() {
$scope.appEvent('show-modal', {
- src: './app/features/dashboard/partials/shareModal.html',
+ src: './app/features/dashboard/partials/sharePanel.html',
scope: $scope.$new()
});
};
diff --git a/src/app/features/panel/soloPanelCtrl.js b/src/app/features/panel/soloPanelCtrl.js
index 1d134a73827..c6a01d9ccfe 100644
--- a/src/app/features/panel/soloPanelCtrl.js
+++ b/src/app/features/panel/soloPanelCtrl.js
@@ -7,10 +7,22 @@ function (angular, $) {
var module = angular.module('grafana.routes');
- module.controller('SoloPanelCtrl', function($scope, backendSrv, $routeParams, dashboardSrv, timeSrv, $location, templateValuesSrv) {
+ module.controller('SoloPanelCtrl',
+ function(
+ $scope,
+ backendSrv,
+ $routeParams,
+ dashboardSrv,
+ timeSrv,
+ $location,
+ templateValuesSrv,
+ contextSrv) {
+
var panelId;
$scope.init = function() {
+ contextSrv.sidemenu = false;
+
var params = $location.search();
panelId = parseInt(params.panelId);
@@ -26,7 +38,7 @@ function (angular, $) {
$scope.dashboard = dashboardSrv.create(dashboard.model);
$scope.row = {
- height: $(window).height() + 'px',
+ height: ($(window).height() - 10) + 'px',
};
$scope.test = "Hej";
diff --git a/src/css/less/forms.less b/src/css/less/forms.less
index 2a6512dd882..eaceabc5834 100644
--- a/src/css/less/forms.less
+++ b/src/css/less/forms.less
@@ -46,5 +46,11 @@ input[type="checkbox"]:checked+label {
height: 100%;
box-sizing: border-box;
}
+ textarea {
+ width: 100%;
+ padding: 5px 6px;
+ height: 100%;
+ box-sizing: border-box;
+ }
}
diff --git a/src/test/specs/soloPanelCtrl-specs.js b/src/test/specs/soloPanelCtrl-specs.js
index 533f966a040..31b45c353f2 100644
--- a/src/test/specs/soloPanelCtrl-specs.js
+++ b/src/test/specs/soloPanelCtrl-specs.js
@@ -10,11 +10,13 @@ define([
var backendSrv = {};
var routeParams = {};
var search = {};
+ var contextSrv = {};
beforeEach(module('grafana.routes'));
beforeEach(module('grafana.services'));
beforeEach(ctx.providePhase({
$routeParams: routeParams,
+ contextSrv: contextSrv,
$location: {
search: function() {
return search;
@@ -57,6 +59,10 @@ define([
expect(ctx.scope.panel.some).to.be('prop');
});
+ it('should hide sidemenu', function() {
+ expect(contextSrv.sidemenu).to.be(false);
+ });
+
});
});