GUAC-897 Using a spinner instead of a distracting modal.

This commit is contained in:
James Muehlner
2014-11-19 23:01:23 -08:00
parent 683fc4475b
commit 41324be7b9
7 changed files with 20 additions and 30 deletions

View File

@@ -40,10 +40,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
$scope.recentConnections = []; $scope.recentConnections = [];
// Set status to loading until we have all the connections and groups loaded // Set status to loading until we have all the connections and groups loaded
$scope.showStatus({ $scope.loading = true;
title : 'status.loadingTitle',
text : 'status.loadingText'
});
/* Fetch all connections and groups, then find which recent connections /* Fetch all connections and groups, then find which recent connections
* still refer to valid connections and groups. * still refer to valid connections and groups.
@@ -83,7 +80,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
} }
}); });
$scope.showStatus(false); $scope.loading = false;
}); });
/** /**

View File

@@ -72,7 +72,7 @@
<!-- All connections for this user --> <!-- All connections for this user -->
<h2>{{'home.allConnections' | translate}}</h2> <h2>{{'home.allConnections' | translate}}</h2>
<div class="all-connections"> <div class="all-connections" ng-class="{loading: loading}">
<div class="list-item" ng-repeat="item in connectionsAndGroups | orderBy : 'name'" ng-include="'nestedGroup.html'"></div> <div class="list-item" ng-repeat="item in connectionsAndGroups | orderBy : 'name'" ng-include="'nestedGroup.html'"></div>
</div> </div>
</div> </div>

View File

@@ -109,3 +109,14 @@
.shown .status { .shown .status {
visibility: visible; visibility: visible;
} }
.loading {
background-image: url(images/spinner.gif);
background-position: center;
background-repeat: no-repeat;
min-height: 200px;
}
.loading * {
visibility: hidden;
}

View File

@@ -36,10 +36,8 @@ angular.module('manage').controller('manageController', ['$scope', '$injector',
var userService = $injector.get('userService'); var userService = $injector.get('userService');
// Set status to loading until we have all the connections, groups, and users have loaded // Set status to loading until we have all the connections, groups, and users have loaded
$scope.showStatus({ $scope.loadingUsers = true;
title : 'status.loadingTitle', $scope.loadingConnections = true;
text : 'status.loadingText'
});
// All the connections and connection groups in root // All the connections and connection groups in root
$scope.connectionsAndGroups = []; $scope.connectionsAndGroups = [];
@@ -47,15 +45,6 @@ angular.module('manage').controller('manageController', ['$scope', '$injector',
// All users that the current user has permission to edit // All users that the current user has permission to edit
$scope.users = []; $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() { $scope.basicPermissionsLoaded.then(function basicPermissionsHaveBeenLoaded() {
connectionGroupService.getAllGroupsAndConnections([], undefined, true, true).then(function filterConnectionsAndGroups(rootGroupList) { connectionGroupService.getAllGroupsAndConnections([], undefined, true, true).then(function filterConnectionsAndGroups(rootGroupList) {
$scope.rootGroup = rootGroupList[0]; $scope.rootGroup = rootGroupList[0];
@@ -73,8 +62,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector',
); );
} }
connectionsAndGroupsLoaded = true; $scope.loadingConnections = false;
checkLoadStatus();
}); });
userDAO.getUsers().success(function filterEditableUsers(users) { userDAO.getUsers().success(function filterEditableUsers(users) {
@@ -89,8 +77,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector',
); );
} }
usersLoaded = true; $scope.loadingUsers = false;
checkLoadStatus();
}); });
}); });

View File

@@ -62,7 +62,7 @@ THE SOFTWARE.
</div> </div>
<!-- List of users this user has access to --> <!-- List of users this user has access to -->
<div class="user-list"> <div class="user-list" ng-class="{loading: loadingUsers}">
<div ng-click="editUser(user)" ng-repeat="user in users | orderBy : 'username'" class="list-item"> <div ng-click="editUser(user)" ng-repeat="user in users | orderBy : 'username'" class="list-item">
<div class="caption"> <div class="caption">
<div class="icon user"></div> <div class="icon user"></div>
@@ -84,7 +84,7 @@ THE SOFTWARE.
</div> </div>
<!-- List of connections and groups this user has access to --> <!-- List of connections and groups this user has access to -->
<div class="connection-list"> <div class="connection-list" ng-class="{loading: loadingConnections}">
<div class="list-item" ng-repeat="item in connectionsAndGroups | orderBy : 'name'" ng-include="'nestedGroup.html'"></div> <div class="list-item" ng-repeat="item in connectionsAndGroups | orderBy : 'name'" ng-include="'nestedGroup.html'"></div>
</div> </div>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,11 +3,6 @@
"title" : "Guacamole ${project.version}" "title" : "Guacamole ${project.version}"
}, },
"status" : {
"loadingTitle" : "Loading",
"loadingText" : "Guacamole is loading; please wait..."
},
"login": { "login": {
"loginError" : "Invalid Login", "loginError" : "Invalid Login",
"username" : "Username", "username" : "Username",