diff --git a/guacamole/src/main/webapp/app/index/controllers/indexController.js b/guacamole/src/main/webapp/app/index/controllers/indexController.js index 5cff9625a..15e781945 100644 --- a/guacamole/src/main/webapp/app/index/controllers/indexController.js +++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js @@ -28,7 +28,15 @@ angular.module('index').controller('indexController', ['$scope', '$injector', var $window = $injector.get('$window'); var clipboardService = $injector.get('clipboardService'); var guacNotification = $injector.get('guacNotification'); - + + /** + * The error that prevents the current page from rendering at all. If no + * such error has occurred, this will be null. + * + * @type Error + */ + $scope.fatalError = null; + /** * The notification service. */ @@ -159,6 +167,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector', $scope.loginHelpText = null; $scope.acceptedCredentials = {}; $scope.expectedCredentials = error.expected; + $scope.fatalError = null; }); // Prompt for remaining credentials if provided credentials were not enough @@ -168,6 +177,15 @@ angular.module('index').controller('indexController', ['$scope', '$injector', $scope.loginHelpText = error.translatableMessage; $scope.acceptedCredentials = parameters; $scope.expectedCredentials = error.expected; + $scope.fatalError = null; + }); + + // Replace absolutely all content with an error message if the page itself + // cannot be displayed due to an error + $scope.$on('guacFatalPageError', function fatalPageError(error) { + $scope.page.title = 'APP.NAME'; + $scope.page.bodyClassName = ''; + $scope.fatalError = error; }); // Update title and CSS class upon navigation @@ -181,6 +199,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector', $scope.loginHelpText = null; $scope.acceptedCredentials = null; $scope.expectedCredentials = null; + $scope.fatalError = null; // Set title var title = current.$$route.title; diff --git a/guacamole/src/main/webapp/app/index/styles/fatal-page-error.css b/guacamole/src/main/webapp/app/index/styles/fatal-page-error.css new file mode 100644 index 000000000..a6e28ba1f --- /dev/null +++ b/guacamole/src/main/webapp/app/index/styles/fatal-page-error.css @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +.fatal-page-error-outer { + display: table; + height: 100%; + width: 100%; + position: fixed; + left: 0; + top: 0; + z-index: 30; +} + +.fatal-page-error-middle { + width: 100%; + text-align: center; + display: table-cell; + vertical-align: middle; +} + +.fatal-page-error { + display: inline-block; + width: 100%; + max-width: 5in; + padding: 1em; + text-align: left; +} + +.fatal-page-error h1 { + text-transform: uppercase; + padding: 0; + padding-right: 1em; +} + +.fatal-page-error h1::before { + content: ' '; + display: inline-block; + background: url('images/warning.png'); + background-repeat: no-repeat; + height: 1em; + width: 1em; + background-size: contain; + margin: 0 0.25em; + margin-bottom: -0.2em; +} diff --git a/guacamole/src/main/webapp/index.html b/guacamole/src/main/webapp/index.html index 5a53d8a23..d4df20d7f 100644 --- a/guacamole/src/main/webapp/index.html +++ b/guacamole/src/main/webapp/index.html @@ -32,26 +32,40 @@ - -
- - -
-
- +
+ + +
+ + +
+
+ +
+ +
+
+
- -
-
- + + + +
- - + +
+
+
+

+

+
+
+
diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json index 92e5de00d..9fa242d09 100644 --- a/guacamole/src/main/webapp/translations/en.json +++ b/guacamole/src/main/webapp/translations/en.json @@ -31,6 +31,7 @@ "DIALOG_HEADER_ERROR" : "Error", + "ERROR_PAGE_UNAVAILABLE" : "An error has occurred and this action cannot be completed. If the problem persists, please notify your system administrator or check your system logs.", "ERROR_PASSWORD_BLANK" : "Your password cannot be blank.", "ERROR_PASSWORD_MISMATCH" : "The provided passwords do not match.",