mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-24 14:55:21 +02:00
Added after-the-fact filtering.
This commit is contained in:
@@ -4,10 +4,12 @@ module.exports = function LogsCtrl($scope, LogcatService) {
|
||||
|
||||
$scope.logEntries = LogcatService.entries
|
||||
|
||||
$scope.filters = LogcatService.filters
|
||||
|
||||
$scope.started = LogcatService.started
|
||||
|
||||
$scope.filters = {}
|
||||
|
||||
$scope.filters.levelNumbers = LogcatService.filters.levelNumbers
|
||||
|
||||
$scope.$watch('started', function (newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
LogcatService.started = newValue
|
||||
@@ -28,4 +30,30 @@ module.exports = function LogsCtrl($scope, LogcatService) {
|
||||
LogcatService.clear()
|
||||
}
|
||||
|
||||
function defineFilterWatchers(props) {
|
||||
angular.forEach(props, function (prop) {
|
||||
$scope.$watch('filters.' + prop, function (newValue, oldValue) {
|
||||
if (!angular.equals(newValue, oldValue)) {
|
||||
LogcatService.filters[prop] = newValue
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
defineFilterWatchers([
|
||||
'levelNumber',
|
||||
'message',
|
||||
'pid',
|
||||
'tid',
|
||||
'dateLabel',
|
||||
'date',
|
||||
'tag',
|
||||
'priority'
|
||||
])
|
||||
|
||||
// $scope.$watchCollection('filters', function (newValue, oldValue) {
|
||||
// console.log(newValue)
|
||||
// });
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user