Commit 3dd383ba by Torkel Ödegaard

solo panel work

parent 3a0983d8
define([
'angular',
'app',
'underscore',
'lodash',
'../graph/timeSeries',
'services/panelSrv',
],
......
<div class="container-fluid main">
<div class="span12">
<div class="panel nospace" ng-if="panel">
<kibana-panel type="panel.type" ng-cloak></kibana-panel>
<div class="row-fluid">
<div class="span12">
<div class="panel nospace" ng-if="panel" style="display:block;">
<grafana-panel type="panel.type" ng-cloak></kibana-panel>
</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();
db.getDashboard($routeParams.id, false)
.then(function(dashboard) {
$scope.initPanelScope(dashboard);
.then(function(dashboardData) {
$scope.initPanelScope(dashboardData);
}).then(null, function(error) {
alertSrv.set('Error', error, 'error');
});
});
$scope.initPanelScope = function(dashboard){
$scope.dashboard = dashboard.create(dashboardData);
$scope.grafana.style = $scope.dashboard.style;
$scope.filter = filterSrv;
$scope.filter.init($scope.dashboard);
};
$scope.initPanelScope = function(dashboardData) {
$scope.dashboard = dashboardSrv.create(dashboardData);
$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.init($scope.dashboard);
};
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment