mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
pro changes
This commit is contained in:
parent
8699dec571
commit
4966b10a0f
@ -48,16 +48,14 @@ function (angular, $, _, appLevelRequire, config) {
|
||||
return module;
|
||||
};
|
||||
|
||||
app.config(function ($routeProvider, $controllerProvider, $compileProvider, $filterProvider, $provide) {
|
||||
|
||||
$routeProvider.otherwise({ redirectTo: config.default_route });
|
||||
app.config(function ($locationProvider, $controllerProvider, $compileProvider, $filterProvider, $provide) {
|
||||
$locationProvider.html5Mode(true);
|
||||
// this is how the internet told me to dynamically add modules :/
|
||||
register_fns.controller = $controllerProvider.register;
|
||||
register_fns.directive = $compileProvider.directive;
|
||||
register_fns.factory = $provide.factory;
|
||||
register_fns.service = $provide.service;
|
||||
register_fns.filter = $filterProvider.register;
|
||||
|
||||
});
|
||||
|
||||
var apps_deps = [
|
||||
@ -84,7 +82,7 @@ function (angular, $, _, appLevelRequire, config) {
|
||||
'directives/all',
|
||||
'filters/all',
|
||||
'components/partials',
|
||||
'routes/all',
|
||||
'routes/p_all',
|
||||
], function () {
|
||||
|
||||
// bootstrap the app
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Bootstrap require with the needed config, then load the app.js module.
|
||||
*/
|
||||
require.config({
|
||||
baseUrl: 'public/app',
|
||||
baseUrl: '/public/app',
|
||||
|
||||
paths: {
|
||||
config: ['../config', '../config.sample'],
|
||||
|
@ -1,45 +0,0 @@
|
||||
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, dashboardSrv, filterSrv) {
|
||||
|
||||
var db = datasourceSrv.getGrafanaDB();
|
||||
|
||||
db.getDashboard($routeParams.id, false)
|
||||
.then(function(dashboardData) {
|
||||
$scope.initPanelScope(dashboardData);
|
||||
}).then(null, function(error) {
|
||||
alertSrv.set('Error', error, 'error');
|
||||
});
|
||||
|
||||
$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);
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user