Commit 3dd383ba by Torkel Ödegaard

solo panel work

parent 3a0983d8
define([ define([
'angular', 'angular',
'app', 'app',
'underscore', 'lodash',
'../graph/timeSeries', '../graph/timeSeries',
'services/panelSrv', 'services/panelSrv',
], ],
......
<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) { ...@@ -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(dashboard){ $scope.initPanelScope = function(dashboardData) {
$scope.dashboard = dashboard.create(dashboardData); $scope.dashboard = dashboardSrv.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);
}; };
});
}); });
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