Ability to select all endpoints via a checkbox (#607)

pull/650/head
Damian 2017-03-12 17:39:27 +01:00 committed by Anthony Lapenna
parent d724f75016
commit 8a827950d8
2 changed files with 12 additions and 1 deletions

View File

@ -137,7 +137,9 @@
<table class="table table-hover">
<thead>
<tr>
<th ng-if="applicationState.application.endpointManagement"></th>
<th ng-if="applicationState.application.endpointManagement">
<input type="checkbox" ng-model="allSelected" ng-change="selectItems(allSelected)" />
</th>
<th>
<a ui-sref="endpoints" ng-click="order('Name')">
Name

View File

@ -28,6 +28,15 @@ function ($scope, $state, EndpointService, EndpointProvider, Messages, Paginatio
Pagination.setPaginationCount('endpoints', $scope.state.pagination_count);
};
$scope.selectItems = function (allSelected) {
angular.forEach($scope.state.filteredEndpoints, function (endpoint) {
if (endpoint.Checked !== allSelected) {
endpoint.Checked = allSelected;
$scope.selectItem(endpoint);
}
});
};
$scope.selectItem = function (item) {
if (item.Checked) {
$scope.state.selectedItemCount++;