You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2021/07/08 03:36:37 UTC

[GitHub] [guacamole-client] jmuehlner commented on a change in pull request #623: GUACAMOLE-724: Add support for displaying multiple connections as tiles.

jmuehlner commented on a change in pull request #623:
URL: https://github.com/apache/guacamole-client/pull/623#discussion_r665845738



##########
File path: guacamole/src/main/frontend/src/app/client/directives/guacClientNotification.js
##########
@@ -0,0 +1,431 @@
+/*
+ * 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.
+ */
+
+/**
+ * A directive for displaying a non-global notification describing the status
+ * of a specific Guacamole client, including prompts for any information
+ * necessary to continue the connection.
+ */
+angular.module('client').directive('guacClientNotification', [function guacClientNotification() {
+
+    var directive = {
+        restrict: 'E',
+        replace: true,
+        templateUrl: 'app/client/templates/guacClientNotification.html'
+    };
+
+    directive.scope = {
+
+        /**
+         * The client whose status should be displayed.
+         * 
+         * @type ManagedClient
+         */
+        client : '='
+        
+    };
+
+    directive.controller = ['$scope', '$injector', '$element',
+        function guacClientNotificationController($scope, $injector, $element) {
+   
+        // Required types
+        var ManagedClient      = $injector.get('ManagedClient');
+        var ManagedClientState = $injector.get('ManagedClientState');
+        var Protocol           = $injector.get('Protocol');
+
+        // Required services
+        var $location              = $injector.get('$location');
+        var authenticationService  = $injector.get('authenticationService');
+        var guacClientManager      = $injector.get('guacClientManager');
+        var requestService         = $injector.get('requestService');
+        var userPageService        = $injector.get('userPageService');
+
+        /**
+         * A Notification object describing the client status to display as a
+         * dialog or prompt, as would be accepted by guacNotification.showStatus(),
+         * or false if no status should be shown.
+         *
+         * @type {Notification|Object|Boolean}
+         */
+        $scope.status = false;
+
+        /**
+         * All client error codes handled and passed off for translation. Any error
+         * code not present in this list will be represented by the "DEFAULT"
+         * translation.
+         */
+        var CLIENT_ERRORS = {

Review comment:
       Have you considered the `Set` type? It's a lot less awkward than this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org