From 41324be7b95120e430d9fa8a12fe0725ee1a1164 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 19 Nov 2014 23:01:23 -0800 Subject: [PATCH] GUAC-897 Using a spinner instead of a distracting modal. --- .../app/home/controllers/homeController.js | 7 ++---- .../main/webapp/app/home/templates/home.html | 2 +- .../main/webapp/app/index/styles/status.css | 11 +++++++++ .../manage/controllers/manageController.js | 21 ++++-------------- .../webapp/app/manage/templates/manage.html | 4 ++-- guacamole/src/main/webapp/images/spinner.gif | Bin 0 -> 1924 bytes .../src/main/webapp/translations/en_US.json | 5 ----- 7 files changed, 20 insertions(+), 30 deletions(-) create mode 100644 guacamole/src/main/webapp/images/spinner.gif diff --git a/guacamole/src/main/webapp/app/home/controllers/homeController.js b/guacamole/src/main/webapp/app/home/controllers/homeController.js index 7203f8e0c..d4f85318b 100644 --- a/guacamole/src/main/webapp/app/home/controllers/homeController.js +++ b/guacamole/src/main/webapp/app/home/controllers/homeController.js @@ -40,10 +40,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector', $scope.recentConnections = []; // Set status to loading until we have all the connections and groups loaded - $scope.showStatus({ - title : 'status.loadingTitle', - text : 'status.loadingText' - }); + $scope.loading = true; /* Fetch all connections and groups, then find which recent connections * still refer to valid connections and groups. @@ -83,7 +80,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector', } }); - $scope.showStatus(false); + $scope.loading = false; }); /** diff --git a/guacamole/src/main/webapp/app/home/templates/home.html b/guacamole/src/main/webapp/app/home/templates/home.html index 5a5ac8346..12857509e 100644 --- a/guacamole/src/main/webapp/app/home/templates/home.html +++ b/guacamole/src/main/webapp/app/home/templates/home.html @@ -72,7 +72,7 @@

{{'home.allConnections' | translate}}

-
+
\ No newline at end of file diff --git a/guacamole/src/main/webapp/app/index/styles/status.css b/guacamole/src/main/webapp/app/index/styles/status.css index bdd64dc47..9242594b7 100644 --- a/guacamole/src/main/webapp/app/index/styles/status.css +++ b/guacamole/src/main/webapp/app/index/styles/status.css @@ -109,3 +109,14 @@ .shown .status { visibility: visible; } + +.loading { + background-image: url(images/spinner.gif); + background-position: center; + background-repeat: no-repeat; + min-height: 200px; +} + +.loading * { + visibility: hidden; +} diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageController.js b/guacamole/src/main/webapp/app/manage/controllers/manageController.js index 891a0a56f..28bed857b 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageController.js @@ -36,10 +36,8 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', var userService = $injector.get('userService'); // Set status to loading until we have all the connections, groups, and users have loaded - $scope.showStatus({ - title : 'status.loadingTitle', - text : 'status.loadingText' - }); + $scope.loadingUsers = true; + $scope.loadingConnections = true; // All the connections and connection groups in root $scope.connectionsAndGroups = []; @@ -47,15 +45,6 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', // All users that the current user has permission to edit $scope.users = []; - // Hide the status message once users, groups, and connections have fully loaded - var usersLoaded = false; - var connectionsAndGroupsLoaded = false; - function checkLoadStatus() { - if(usersLoaded && connectionsAndGroupsLoaded) { - $scope.showStatus(false); - } - } - $scope.basicPermissionsLoaded.then(function basicPermissionsHaveBeenLoaded() { connectionGroupService.getAllGroupsAndConnections([], undefined, true, true).then(function filterConnectionsAndGroups(rootGroupList) { $scope.rootGroup = rootGroupList[0]; @@ -73,8 +62,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', ); } - connectionsAndGroupsLoaded = true; - checkLoadStatus(); + $scope.loadingConnections = false; }); userDAO.getUsers().success(function filterEditableUsers(users) { @@ -89,8 +77,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', ); } - usersLoaded = true; - checkLoadStatus(); + $scope.loadingUsers = false; }); }); diff --git a/guacamole/src/main/webapp/app/manage/templates/manage.html b/guacamole/src/main/webapp/app/manage/templates/manage.html index cdbdbea15..f72142c25 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manage.html +++ b/guacamole/src/main/webapp/app/manage/templates/manage.html @@ -62,7 +62,7 @@ THE SOFTWARE. -
+
@@ -84,7 +84,7 @@ THE SOFTWARE.
-
+
diff --git a/guacamole/src/main/webapp/images/spinner.gif b/guacamole/src/main/webapp/images/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..48f9928b5956cdc3eb7f69a92dcd19a19f1bbbde GIT binary patch literal 1924 zcmciDSx{3~90u?RH>$=Sx5pEl!}Qm1Op}@wBiC-99$q24Fm*1s0L(_HEh9z zEI67j|{yVeg| z=h~qx%6FjIxn_PGd+V;iq^~J zQkg&)E*4l7m-O_lb*Q&0a~Qiot!CWEH<6~;b;RjY4~c60#Ivpu?!3-O)Gha!h{Sb? z>-UeYC zPXn_uP%$BnsZ;=hX3>i%C0=|1facN*sl4(4UnmQjYy~ZZC~A~V%_@>9h9-mnfzQOl zBtS=y4?!(~W3SoYA>S40N3a$4TEWo$YQk+vAE&dZ+qcKMwaq}AR1PnVD__2zZuxP? zy28=_LP*`uTL^s|@@a+*%Qpv|N6SZM(TmY(G=8#Bv~~~=fgxlFI5vO;W>sTL@G@fn zo~MaQii&xw6$oY%8mY~}avPHvWsHH2XhjS)Li9A42GDT^H1Oo_$cEYE$E`D*hnh#6 zQRTR(fAA%4UEh0yCbIG0H~0@ekm=9G2r3yNgvlvYt^v5~bpYIzjZslTy|C?M&1r0N z-K|))U9GAiR*AbISD;LZ_)29%)?n5H;XOG-)IO&Y%~GEUjRAOJ-at~(QQxD+EImSIOiWmqkB$aUDx2#RjNL$#0@&GsVo&Gs?%l4`Mi;rYt? zW9EY!Oye?~uiozpqi19W2Qu7Xjm>T;+i9OWV?X;L)jj-V6w4~@K}V9y)<*(A-HeTN z@%e3hV9=MrCzywF@(T)!ii1rZ@Q~mbvbm6cB*ls!1i5|=9Yrtms0pvTh^nT_X`H=i zXuUb~n9LSh4e1v3zq=~7_c)B;+A0|e&-0{C{1kB-J3%tw$B1*o`SSx$wND0@UQFtY OK*AP~``R67T7Ll4`y{ad literal 0 HcmV?d00001 diff --git a/guacamole/src/main/webapp/translations/en_US.json b/guacamole/src/main/webapp/translations/en_US.json index df3471756..c1b90caac 100644 --- a/guacamole/src/main/webapp/translations/en_US.json +++ b/guacamole/src/main/webapp/translations/en_US.json @@ -3,11 +3,6 @@ "title" : "Guacamole ${project.version}" }, - "status" : { - "loadingTitle" : "Loading", - "loadingText" : "Guacamole is loading; please wait..." - }, - "login": { "loginError" : "Invalid Login", "username" : "Username",