From 979349388cee6f9f35f4b85b473cfe05e86ef57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 8 Jan 2015 09:46:11 +0100 Subject: [PATCH] Added 404 not found view --- src/app/controllers/all.js | 1 + src/app/controllers/errorCtrl.js | 22 ++++++++++++++++++++++ src/app/partials/error.html | 11 +++++++++++ src/app/routes/backend/all.js | 1 + 4 files changed, 35 insertions(+) create mode 100644 src/app/controllers/errorCtrl.js create mode 100644 src/app/partials/error.html 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' }); });