Commit 4966b10a by Torkel Ödegaard

pro changes

parent 8699dec5
......@@ -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'],
......
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);
};
});
});
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