Event log select all checkbox

Previously the select all checkbox selected
all events, regardless of the filter applied.
In addition, if all the events on a filtered
page were selected, the checkbox was not checked.

Resolves openbmc/openbmc#3373

Tested: select all checkbox selects only the
  events visible to the user. If all events
  are selected, 'select all' checkbox is
  checked.

Change-Id: Ibd5d1942b5c1c745a544d680288fd10206c7bbc6
Signed-off-by: beccabroek <beccabroek@gmail.com>
diff --git a/app/server-health/controllers/log-controller.html b/app/server-health/controllers/log-controller.html
index d04a964..8fc99bc 100644
--- a/app/server-health/controllers/log-controller.html
+++ b/app/server-health/controllers/log-controller.html
@@ -33,7 +33,7 @@
         <div id="event__actions-bar" class="row header__actions-bar no-margin">
             <div class="column small-1 large-1 event-log__col-check">
                 <label class="control-check">
-                    <input type="checkbox" name="events__check-all" ng-model="all" ng-checked="((logs|filter:{selected: true}).length == logs.length) && logs.length != 0"/>
+                    <input type="checkbox" name="events__check-all" ng-model="all" ng-checked="((filteredLogs|filter:{selected: true}).length == filteredLogs.length) && filteredLogs.length != 0"/>
                     <span class="control__indicator"></span>
                 </label>
             </div>
diff --git a/app/server-health/controllers/log-controller.js b/app/server-health/controllers/log-controller.js
index 68599f0..97e4b28 100644
--- a/app/server-health/controllers/log-controller.js
+++ b/app/server-health/controllers/log-controller.js
@@ -142,7 +142,7 @@
           };
 
           $scope.$watch('all', function() {
-            $scope.logs.forEach(function(item) {
+            $scope.filteredLogs.forEach(function(item) {
               item.selected = $scope.all;
             });
           });