Torkel Ödegaard 11 лет назад
Родитель
Сommit
979349388c

+ 1 - 0
src/app/controllers/all.js

@@ -8,4 +8,5 @@ define([
   './jsonEditorCtrl',
   './loginCtrl',
   './registerCtrl',
+  './errorCtrl',
 ], function () {});

+ 22 - 0
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;
+    });
+
+  });
+
+});

+ 11 - 0
src/app/partials/error.html

@@ -0,0 +1,11 @@
+
+<div class="row-fluid" style="margin-top: 100px;">
+	<div class="span2"></div>
+
+	<div class="grafana-info-box span8 text-center">
+			<h3>Page not found (404)</h3>
+		</div>
+
+	<div class="span2"></div>
+
+</div>

+ 1 - 0
src/app/routes/backend/all.js

@@ -52,6 +52,7 @@ define([
       })
       .otherwise({
         templateUrl: 'app/partials/error.html',
+        controller: 'ErrorCtrl'
       });
   });