summaryrefslogtreecommitdiffstats
path: root/src/main/resources/controllers/locationFieldController.js
diff options
context:
space:
mode:
authorUdo Walter2020-05-09 01:41:41 +0200
committerUdo Walter2020-05-09 01:41:41 +0200
commit62b83a7a18e1878cf8192d80f02c10dffc0478d7 (patch)
treeb3e071dbecea6bb0b71babb55c8cedbae07582a5 /src/main/resources/controllers/locationFieldController.js
parentAdd location selection (diff)
downloadbwlp-guacamole-ext-62b83a7a18e1878cf8192d80f02c10dffc0478d7.tar.gz
bwlp-guacamole-ext-62b83a7a18e1878cf8192d80f02c10dffc0478d7.tar.xz
bwlp-guacamole-ext-62b83a7a18e1878cf8192d80f02c10dffc0478d7.zip
Fix connecting to a new client after exiting a client. Add logo, favicon and logout button.
Diffstat (limited to 'src/main/resources/controllers/locationFieldController.js')
-rw-r--r--src/main/resources/controllers/locationFieldController.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/resources/controllers/locationFieldController.js b/src/main/resources/controllers/locationFieldController.js
index 8117ed7..af2b6fe 100644
--- a/src/main/resources/controllers/locationFieldController.js
+++ b/src/main/resources/controllers/locationFieldController.js
@@ -1,9 +1,12 @@
-angular.module('location').controller('locationFieldController', ['$scope', '$window',
- function locationFieldController($scope, $window) {
+angular.module('location').controller('locationFieldController', ['$scope', function locationFieldController($scope) {
- $scope.data = { id: 0, password: '' }
+ $scope.data = { id: 0, password: '' };
$scope.$watch('data', function(newValue) {
+ if (window.location.hash !== '#/') {
+ window.location.hash = '#/';
+ window.location.reload();
+ }
$scope.model = JSON.stringify(newValue);
}, true);
@@ -20,4 +23,10 @@ angular.module('location').controller('locationFieldController', ['$scope', '$wi
angular.element($event.currentTarget).addClass('selected-location');
};
+ $scope.logout = function logout() {
+ window.localStorage.removeItem('GUAC_AUTH');
+ window.location.hash = '#/';
+ window.location.reload();
+ }
+
}]); \ No newline at end of file