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

This commit is contained in:
Michael Jumper
2015-11-02 13:15:37 -08:00
parent a1071832fb
commit 835cb21315
7 changed files with 21 additions and 2 deletions

View File

@@ -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;