mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
solo panel work
This commit is contained in:
parent
3a0983d8bf
commit
3dd383ba11
@ -1,7 +1,7 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
'app',
|
'app',
|
||||||
'underscore',
|
'lodash',
|
||||||
'../graph/timeSeries',
|
'../graph/timeSeries',
|
||||||
'services/panelSrv',
|
'services/panelSrv',
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<div class="container-fluid main">
|
<div class="container-fluid main">
|
||||||
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="panel nospace" ng-if="panel">
|
<div class="panel nospace" ng-if="panel" style="display:block;">
|
||||||
<kibana-panel type="panel.type" ng-cloak></kibana-panel>
|
<grafana-panel type="panel.type" ng-cloak></kibana-panel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,28 +14,32 @@ function (angular) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('SoloPanelCtrl', function($scope, $rootScope, datasourceSrv, $routeParams, alertSrv, dashboard) {
|
module.controller('SoloPanelCtrl', function($scope, $rootScope, datasourceSrv, $routeParams, alertSrv, dashboardSrv, filterSrv) {
|
||||||
|
|
||||||
var db = datasourceSrv.getGrafanaDB();
|
var db = datasourceSrv.getGrafanaDB();
|
||||||
|
|
||||||
db.getDashboard($routeParams.id, false)
|
db.getDashboard($routeParams.id, false)
|
||||||
.then(function(dashboard) {
|
.then(function(dashboardData) {
|
||||||
$scope.initPanelScope(dashboard);
|
$scope.initPanelScope(dashboardData);
|
||||||
}).then(null, function(error) {
|
}).then(null, function(error) {
|
||||||
alertSrv.set('Error', error, 'error');
|
alertSrv.set('Error', error, 'error');
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
$scope.initPanelScope = function(dashboardData) {
|
||||||
$scope.initPanelScope = function(dashboard){
|
$scope.dashboard = dashboardSrv.create(dashboardData);
|
||||||
$scope.dashboard = dashboard.create(dashboardData);
|
|
||||||
$scope.grafana.style = $scope.dashboard.style;
|
$scope.grafana.style = $scope.dashboard.style;
|
||||||
|
$scope.row = {
|
||||||
|
height: '300px',
|
||||||
|
};
|
||||||
|
$scope.test = "Hej";
|
||||||
|
$scope.$index = 0;
|
||||||
|
$scope.panel = $scope.dashboard.rows[0].panels[0];
|
||||||
|
$scope.panel.span = 12;
|
||||||
|
|
||||||
$scope.filter = filterSrv;
|
$scope.filter = filterSrv;
|
||||||
$scope.filter.init($scope.dashboard);
|
$scope.filter.init($scope.dashboard);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user