Commit 164435f7 by Torkel Ödegaard

Moving code arround

parent d3e11cab
......@@ -7,4 +7,5 @@ define([
'./inspectCtrl',
'./jsonEditorCtrl',
'./loginCtrl',
'./registerCtrl',
], function () {});
......@@ -6,18 +6,6 @@ function (angular) {
var module = angular.module('grafana.routes');
module.config(function($routeProvider) {
$routeProvider
.when('/login', {
templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl',
})
.when('/register', {
templateUrl: 'app/partials/register.html',
controller : 'RegisterCtrl',
});
});
module.controller('RegisterCtrl', function($scope, backendSrv, $location) {
$scope.loginModel = {};
$scope.grafana.sidemenu = false;
......
......@@ -10,5 +10,6 @@ define([
'./viewStateSrv',
'./playlistSrv',
'./panelSrv',
'./soloPanelCtrl',
'./timeSrv',
], function () {});
......@@ -7,14 +7,6 @@ function (angular, $) {
var module = angular.module('grafana.routes');
module.config(function($routeProvider) {
$routeProvider
.when('/dashboard/solo/:id/', {
templateUrl: 'app/partials/solo-panel.html',
controller : 'SoloPanelCtrl',
});
});
module.controller('SoloPanelCtrl', function($scope, $rootScope, datasourceSrv, $routeParams, dashboardSrv, timeSrv, $location) {
var panelId;
......
......@@ -63,7 +63,7 @@ function (angular, _, kbn) {
};
GrafanaDatasource.prototype.searchDashboards = function(query) {
return backendSrv.get('/api/search/', { q: query } )
return backendSrv.get('/api/search/', {q: query})
.then(function(data) {
_.each(data.dashboards, function(item) {
item.id = item.slug;
......
define([
'angular',
],
function (angular) {
"use strict";
var module = angular.module('grafana.routes');
module.config(function($routeProvider) {
$routeProvider
.when('/admin/datasources', {
templateUrl: 'app/features/admin/partials/datasources.html',
controller : 'DataSourcesCtrl',
})
.when('/account', {
templateUrl: 'app/features/admin/partials/account.html',
controller : 'AccountCtrl',
});
});
});
define([
'angular',
'./dashboard',
'./admin',
'./login',
'./solo-panel',
], function() {});
], function(angular) {
"use strict";
var module = angular.module('grafana.routes');
module.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/db/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/temp/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/import/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromImportCtrl',
reloadOnSearch: false,
})
.when('/admin/datasources', {
templateUrl: 'app/features/admin/partials/datasources.html',
controller : 'DataSourcesCtrl',
})
.when('/account', {
templateUrl: 'app/features/admin/partials/account.html',
controller : 'AccountCtrl',
})
.when('/login', {
templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl',
})
.when('/register', {
templateUrl: 'app/partials/register.html',
controller : 'RegisterCtrl',
})
.when('/dashboard/solo/:id/', {
templateUrl: 'app/partials/solo-panel.html',
controller : 'SoloPanelCtrl',
});
});
});
......@@ -7,32 +7,6 @@ function (angular, store) {
var module = angular.module('grafana.routes');
module.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/db/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/temp/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromDBProvider',
reloadOnSearch: false,
})
.when('/dashboard/import/:id', {
templateUrl: 'app/partials/dashboard.html',
controller : 'DashFromImportCtrl',
reloadOnSearch: false,
});
});
// remember previous dashboard
var prevDashPath = null;
......
define([
'helpers',
'routes/backend/solo-panel',
'controllers/soloPanelCtrl',
'features/dashboard/dashboardSrv',
], function(helpers) {
'use strict';
......
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