mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
snapshots: fixed snapshot issues, fixes #10214
This commit is contained in:
parent
4e38526404
commit
4f56d4ac07
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h2 class="modal-header-title">
|
<h2 class="modal-header-title">
|
||||||
{{modalTitle}}
|
<i class="fa fa-share-square-o"></i>
|
||||||
|
<span class="p-l-1">{{modalTitle}}</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<ul class="gf-tabs">
|
<ul class="gf-tabs">
|
||||||
|
@ -103,14 +103,17 @@ function (angular, _) {
|
|||||||
$scope.scrubDashboard = function(dash) {
|
$scope.scrubDashboard = function(dash) {
|
||||||
// change title
|
// change title
|
||||||
dash.title = $scope.snapshot.name;
|
dash.title = $scope.snapshot.name;
|
||||||
|
|
||||||
// make relative times absolute
|
// make relative times absolute
|
||||||
dash.time = timeSrv.timeRange();
|
dash.time = timeSrv.timeRange();
|
||||||
|
|
||||||
// remove panel queries & links
|
// remove panel queries & links
|
||||||
dash.forEachPanel(function(panel) {
|
_.each(dash.panels, function(panel) {
|
||||||
panel.targets = [];
|
panel.targets = [];
|
||||||
panel.links = [];
|
panel.links = [];
|
||||||
panel.datasource = null;
|
panel.datasource = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove annotation queries
|
// remove annotation queries
|
||||||
dash.annotations.list = _.chain(dash.annotations.list)
|
dash.annotations.list = _.chain(dash.annotations.list)
|
||||||
.filter(function(annotation) {
|
.filter(function(annotation) {
|
||||||
@ -124,6 +127,7 @@ function (angular, _) {
|
|||||||
snapshotData: annotation.snapshotData
|
snapshotData: annotation.snapshotData
|
||||||
};
|
};
|
||||||
}).value();
|
}).value();
|
||||||
|
|
||||||
// remove template queries
|
// remove template queries
|
||||||
_.each(dash.templating.list, function(variable) {
|
_.each(dash.templating.list, function(variable) {
|
||||||
variable.query = "";
|
variable.query = "";
|
||||||
@ -133,9 +137,12 @@ function (angular, _) {
|
|||||||
|
|
||||||
// snapshot single panel
|
// snapshot single panel
|
||||||
if ($scope.modeSharePanel) {
|
if ($scope.modeSharePanel) {
|
||||||
var singlePanel = dash.getPanelById($scope.panel.id);
|
var singlePanel = $scope.panel.getSaveModel();
|
||||||
singlePanel.span = 12;
|
singlePanel.gridPos.w = 24;
|
||||||
dash.rows = [{ height: '500px', span: 12, panels: [singlePanel] }];
|
singlePanel.gridPos.x = 0;
|
||||||
|
singlePanel.gridPos.y = 0;
|
||||||
|
singlePanel.gridPos.h = 20;
|
||||||
|
dash.panels = [singlePanel];
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup snapshotData
|
// cleanup snapshotData
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
.modal-header-close {
|
.modal-header-close {
|
||||||
float: right;
|
float: right;
|
||||||
padding: 0.75rem $spacer;
|
padding: 9px $spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Body (where all modal content resides)
|
// Body (where all modal content resides)
|
||||||
|
Loading…
Reference in New Issue
Block a user