mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Began work on solo panel
This commit is contained in:
parent
c416b09089
commit
a0780ce48a
7
src/app/partials/solo-panel.html
Normal file
7
src/app/partials/solo-panel.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -1,5 +1,6 @@
|
|||||||
define([
|
define([
|
||||||
'./dashboard-from-db',
|
'./dashboard-from-db',
|
||||||
|
'./solo-panel-route',
|
||||||
'./dashboard-from-file',
|
'./dashboard-from-file',
|
||||||
'./dashboard-from-script',
|
'./dashboard-from-script',
|
||||||
'./dashboard-default',
|
'./dashboard-default',
|
||||||
|
41
src/app/routes/solo-panel-route.js
Normal file
41
src/app/routes/solo-panel-route.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
define([
|
||||||
|
'angular',
|
||||||
|
],
|
||||||
|
function (angular) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var module = angular.module('grafana.routes');
|
||||||
|
|
||||||
|
module.config(function($routeProvider) {
|
||||||
|
$routeProvider
|
||||||
|
.when('/solo-panel/db/:id', {
|
||||||
|
templateUrl: 'app/partials/solo-panel.html',
|
||||||
|
controller : 'SoloPanelCtrl',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.controller('SoloPanelCtrl', function($scope, $rootScope, datasourceSrv, $routeParams, alertSrv, dashboard) {
|
||||||
|
|
||||||
|
var db = datasourceSrv.getGrafanaDB();
|
||||||
|
|
||||||
|
db.getDashboard($routeParams.id, false)
|
||||||
|
.then(function(dashboard) {
|
||||||
|
$scope.initPanelScope(dashboard);
|
||||||
|
}).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);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user