simplify the sessions UI
This commit is contained in:
@@ -8,10 +8,10 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
$scope.user = Client.getUserInfo();
|
||||
$scope.config = Client.getConfig();
|
||||
|
||||
$scope.activeTokens = 0;
|
||||
$scope.activeClients = [];
|
||||
$scope.webadminClient = {};
|
||||
$scope.apiClient = {};
|
||||
$scope.cliClient = {};
|
||||
$scope.showApiTokens = !!$location.search().tokens;
|
||||
|
||||
$scope.twoFactorAuthentication = {
|
||||
@@ -391,13 +391,9 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
asyncForEach(activeClients, refreshClientTokens, function () {
|
||||
$scope.webadminClient = activeClients.filter(function (c) { return c.id === 'cid-webadmin'; })[0];
|
||||
$scope.apiClient = activeClients.filter(function (c) { return c.id === 'cid-sdk'; })[0];
|
||||
$scope.cliClient = activeClients.filter(function (c) { return c.id === 'cid-cli'; })[0];
|
||||
|
||||
activeClients = activeClients.filter(function (c) { return c.activeTokens.length > 0; });
|
||||
|
||||
$scope.activeClients = activeClients.filter(function (c) { return c.id !== 'cid-sdk' && c.id !== 'cid-webadmin'; });
|
||||
|
||||
$scope.activeTokenCount = $scope.activeClients.reduce(function (prev, cur) { return prev + cur.activeTokens.length; }, 0);
|
||||
$scope.activeTokenCount += $scope.webadminClient ? $scope.webadminClient.activeTokens.length : 0;
|
||||
$scope.activeClients = activeClients;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user