diff --git a/src/app/controllers/p_grafanaCtrl.js b/src/app/controllers/p_grafanaCtrl.js index 65bb8745195..e9484d76d64 100644 --- a/src/app/controllers/p_grafanaCtrl.js +++ b/src/app/controllers/p_grafanaCtrl.js @@ -14,7 +14,7 @@ function (angular, config, _, $, store) { $scope.grafanaVersion = grafanaVersion[0] === '@' ? 'master' : grafanaVersion; $scope.consoleEnabled = store.getBool('grafanaConsole'); - //$scope.showProSideMenu = store.getBool('grafanaProSideMenu'); + $scope.showProSideMenu = store.getBool('grafanaProSideMenu'); $rootScope.profilingEnabled = store.getBool('profilingEnabled'); $rootScope.performance = { loadStart: new Date().getTime() }; diff --git a/src/app/partials/pro/dashboard_topnav.html b/src/app/partials/pro/dashboard_topnav.html index fdd0cba101d..21d7b7704e7 100644 --- a/src/app/partials/pro/dashboard_topnav.html +++ b/src/app/partials/pro/dashboard_topnav.html @@ -3,9 +3,9 @@
- + - {{dashboard.title}} + {{dashboard.title}} -
  • -
  • +
  • diff --git a/src/app/partials/pro/sidemenu.html b/src/app/partials/pro/sidemenu.html index fa309e9c37e..64427daa6da 100644 --- a/src/app/partials/pro/sidemenu.html +++ b/src/app/partials/pro/sidemenu.html @@ -1,19 +1,6 @@ - -
    - - + + logout diff --git a/src/app/routes/p_login.js b/src/app/routes/p_login.js index 91f9242a300..bdab6d02e18 100644 --- a/src/app/routes/p_login.js +++ b/src/app/routes/p_login.js @@ -1,5 +1,6 @@ define([ 'angular', + '../controllers/p_loginCtrl', ], function (angular) { "use strict"; @@ -47,47 +48,4 @@ function (angular) { }); - - module.controller('LoginCtrl', function($scope, $http, $location, $routeParams, alertSrv) { - $scope.loginModel = {}; - - $scope.init = function() { - if ($routeParams.logout) { - $scope.logout(); - } - }; - - $scope.logout = function() { - $http.post('/logout').then(function() { - alertSrv.set('Logged out!', '', 'success', 3000); - $scope.emitAppEvent('logged-out'); - }, function() { - alertSrv.set('Logout failed:', 'Unexpected error', 'error', 3000); - }); - }; - - $scope.login = function() { - delete $scope.loginError; - - if (!$scope.loginForm.$valid) { - return; - } - - $http.post('/login', $scope.loginModel).then(function() { - $scope.emitAppEvent('logged-in'); - $location.path('/'); - }, function(err) { - if (err.status === 401) { - $scope.loginError = "Username or password is incorrect"; - } - else { - $scope.loginError = "Unexpected error"; - } - }); - }; - - $scope.init(); - - }); - }); diff --git a/src/app/services/grafana/grafanaDatasource.js b/src/app/services/grafana/grafanaDatasource.js index 684d0abe25f..13bfafa8add 100644 --- a/src/app/services/grafana/grafanaDatasource.js +++ b/src/app/services/grafana/grafanaDatasource.js @@ -55,6 +55,15 @@ function (angular) { }); }; + GrafanaDatasource.prototype.deleteDashboard = function(id) { + return $http({ method: 'DELETE', url: '/api/dashboard/' + id }) + .then(function(result) { + return result.data.title; + }, function(err) { + throw err.data; + }); + }; + GrafanaDatasource.prototype.searchDashboards = function(query) { return $http.get('/api/search/', { params: { q: query } }) .then(function(results) {