diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 60e3fe7b150..9f162c53ca5 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -8,4 +8,5 @@ define([ './jsonEditorCtrl', './loginCtrl', './registerCtrl', + './errorCtrl', ], function () {}); diff --git a/src/app/controllers/errorCtrl.js b/src/app/controllers/errorCtrl.js new file mode 100644 index 00000000000..97f606fcaa3 --- /dev/null +++ b/src/app/controllers/errorCtrl.js @@ -0,0 +1,22 @@ +define([ + 'angular', + 'app', + 'lodash' +], +function (angular) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('ErrorCtrl', function($scope) { + + var showSideMenu = $scope.grafana.sidemenu; + $scope.grafana.sidemenu = false; + + $scope.$on('$destroy', function() { + $scope.grafana.sidemenu = showSideMenu; + }); + + }); + +}); diff --git a/src/app/partials/error.html b/src/app/partials/error.html new file mode 100644 index 00000000000..d38f71ac5d8 --- /dev/null +++ b/src/app/partials/error.html @@ -0,0 +1,11 @@ + +
+
+ +
+

Page not found (404)

+
+ +
+ +
diff --git a/src/app/routes/backend/all.js b/src/app/routes/backend/all.js index b3c03fa42ac..a99d2b37b46 100644 --- a/src/app/routes/backend/all.js +++ b/src/app/routes/backend/all.js @@ -52,6 +52,7 @@ define([ }) .otherwise({ templateUrl: 'app/partials/error.html', + controller: 'ErrorCtrl' }); });