GUAC-1376: Add logout action to disconnect/error notification in client.

This commit is contained in:
Michael Jumper committed 2015-11-02 13:18:04 -08:00
1 parent a1071832fb
commit 835cb21315
7 files changed
+21 -2

No files matched your search

@@ -130,6 +130,19 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
0x0308: true
};
/**
* Action which logs out from Guacamole entirely.
*/
var LOGOUT_ACTION = {
name : "CLIENT.ACTION_LOGOUT",
className : "logout button",
callback : function logoutCallback() {
authenticationService.logout()['finally'](function logoutComplete() {
$location.url('/');
});
}
};
/**
* Action which returns the user to the home screen. If the home page has
* not yet been determined, this will be null.
@@ -447,9 +460,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Build array of available actions
var actions;
if (NAVIGATE_HOME_ACTION)
actions = [ NAVIGATE_HOME_ACTION, RECONNECT_ACTION ];
actions = [ NAVIGATE_HOME_ACTION, RECONNECT_ACTION, LOGOUT_ACTION ];
else
actions = [ RECONNECT_ACTION ];
actions = [ RECONNECT_ACTION, LOGOUT_ACTION ];
// Get any associated status code
var status = $scope.client.clientState.statusCode;