summaryrefslogtreecommitdiffstats
path: root/src/main/resources/controllers/groupFieldController.js
diff options
context:
space:
mode:
authorUdo Walter2020-05-13 14:04:52 +0200
committerUdo Walter2020-05-13 14:04:52 +0200
commite5a3a1d737e88c89a4ba3fbc8d277745093139b1 (patch)
tree9fac401c4a848eb3a38429f17e6050eaa506dd2e /src/main/resources/controllers/groupFieldController.js
parentFix connecting to a new client after exiting a client. Add logo, favicon and ... (diff)
downloadbwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.tar.gz
bwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.tar.xz
bwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.zip
Add some debug logs. Rename the 'virtual' locations to groups.
Diffstat (limited to 'src/main/resources/controllers/groupFieldController.js')
-rw-r--r--src/main/resources/controllers/groupFieldController.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/resources/controllers/groupFieldController.js b/src/main/resources/controllers/groupFieldController.js
new file mode 100644
index 0000000..3b6f9ea
--- /dev/null
+++ b/src/main/resources/controllers/groupFieldController.js
@@ -0,0 +1,32 @@
+angular.module('group').controller('groupFieldController', ['$scope', function groupFieldController($scope) {
+
+ $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);
+
+ $scope.selectGroup = function selectGroup($event, id) {
+ if (angular.element($event.target).hasClass('bwlp-password-input')) return;
+ $scope.data.password = '';
+ if ($scope.data.id === id) {
+ $scope.data.id = 0;
+ angular.element('.selected-group').removeClass('selected-group');
+ return;
+ }
+ $scope.data.id = id;
+ angular.element('.selected-group').removeClass('selected-group');
+ angular.element($event.currentTarget).addClass('selected-group');
+ };
+
+ $scope.logout = function logout() {
+ window.localStorage.removeItem('GUAC_AUTH');
+ window.location.hash = '#/';
+ window.location.reload();
+ }
+
+}]); \ No newline at end of file