|
|
@@ -103,14 +103,17 @@ function (angular, _) {
|
|
|
$scope.scrubDashboard = function(dash) {
|
|
|
// change title
|
|
|
dash.title = $scope.snapshot.name;
|
|
|
+
|
|
|
// make relative times absolute
|
|
|
dash.time = timeSrv.timeRange();
|
|
|
+
|
|
|
// remove panel queries & links
|
|
|
- dash.forEachPanel(function(panel) {
|
|
|
+ _.each(dash.panels, function(panel) {
|
|
|
panel.targets = [];
|
|
|
panel.links = [];
|
|
|
panel.datasource = null;
|
|
|
});
|
|
|
+
|
|
|
// remove annotation queries
|
|
|
dash.annotations.list = _.chain(dash.annotations.list)
|
|
|
.filter(function(annotation) {
|
|
|
@@ -124,6 +127,7 @@ function (angular, _) {
|
|
|
snapshotData: annotation.snapshotData
|
|
|
};
|
|
|
}).value();
|
|
|
+
|
|
|
// remove template queries
|
|
|
_.each(dash.templating.list, function(variable) {
|
|
|
variable.query = "";
|
|
|
@@ -133,9 +137,12 @@ function (angular, _) {
|
|
|
|
|
|
// snapshot single panel
|
|
|
if ($scope.modeSharePanel) {
|
|
|
- var singlePanel = dash.getPanelById($scope.panel.id);
|
|
|
- singlePanel.span = 12;
|
|
|
- dash.rows = [{ height: '500px', span: 12, panels: [singlePanel] }];
|
|
|
+ var singlePanel = $scope.panel.getSaveModel();
|
|
|
+ singlePanel.gridPos.w = 24;
|
|
|
+ singlePanel.gridPos.x = 0;
|
|
|
+ singlePanel.gridPos.y = 0;
|
|
|
+ singlePanel.gridPos.h = 20;
|
|
|
+ dash.panels = [singlePanel];
|
|
|
}
|
|
|
|
|
|
// cleanup snapshotData
|