mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-11-04 02:53:22 +00:00 
			
		
		
		
	GUACAMOLE-723: Display warning icon when background connection disconnects due to an error.
This commit is contained in:
		@@ -24,8 +24,12 @@
 | 
			
		||||
 */
 | 
			
		||||
angular.module('client').directive('guacClientPanel', ['$injector', function guacClientPanel($injector) {
 | 
			
		||||
 | 
			
		||||
    // Required services
 | 
			
		||||
    var sessionStorageFactory = $injector.get('sessionStorageFactory');
 | 
			
		||||
 | 
			
		||||
    // Required types
 | 
			
		||||
    var ManagedClientState = $injector.get('ManagedClientState');
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Getter/setter for the boolean flag controlling whether the client panel
 | 
			
		||||
     * is currently hidden. This flag is maintained in session-local storage to
 | 
			
		||||
@@ -81,6 +85,30 @@ angular.module('client').directive('guacClientPanel', ['$injector', function gua
 | 
			
		||||
                return !_.isEmpty($scope.clients);
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Returns whether the given client has disconnected due to an
 | 
			
		||||
             * error.
 | 
			
		||||
             *
 | 
			
		||||
             * @param {ManagedClient} client
 | 
			
		||||
             *     The client to test.
 | 
			
		||||
             *
 | 
			
		||||
             * @returns {Boolean}
 | 
			
		||||
             *     true if the given client has disconnected due to an error,
 | 
			
		||||
             *     false otherwise.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.hasError = function hasError(client) {
 | 
			
		||||
 | 
			
		||||
                // Test whether the client has encountered an error
 | 
			
		||||
                switch (client.clientState.connectionState) {
 | 
			
		||||
                    case ManagedClientState.ConnectionState.CONNECTION_ERROR:
 | 
			
		||||
                    case ManagedClientState.ConnectionState.TUNNEL_ERROR:
 | 
			
		||||
                        return true;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Toggles whether the client panel is currently hidden.
 | 
			
		||||
             */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user