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 2020/04/24 11:51:26 UTC

[GitHub] [guacamole-client] necouchman commented on a change in pull request #430: GUACAMOLE-221: Client-side changes for parameter prompting

necouchman commented on a change in pull request #430:
URL: https://github.com/apache/guacamole-client/pull/430#discussion_r414515534



##########
File path: guacamole/src/main/webapp/app/client/types/ManagedClient.js
##########
@@ -577,13 +582,28 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
                 managedClient.filesystems.push(ManagedFilesystem.getInstance(object, name));
             });
         };
+        
+        // Handle any received prompts
+        client.onrequired = function onrequired(parameters) {
+            
+            guacPrompt.getUserInput(parameters.reduce((a,b)=> (a[b]='',a),{}))
+                    .then(function gotUserInput(data) {
+                        for (var parameter in data) {
+                            var stream = client.createArgumentValueStream("text/plain", parameter);
+                            var writer = new Guacamole.StringWriter(stream);
+                            writer.sendText(data[parameter]);
+                            writer.sendEnd();
+                        }
+
+                }, function errorUserInput() {
+                    $log.error('Error gathering user input.');
+                    client.disconnect();
+                });

Review comment:
       Ah, yes - okay, good to know.  I'll have to figure out how to pull the forms for the underlying connection...




----------------------------------------------------------------
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.

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