1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00

Log filter on first load.

This commit is contained in:
Gunther Brunner 2014-05-21 17:48:44 +09:00
parent 97e106760f
commit 1b992d67a6
3 changed files with 9 additions and 4 deletions

View file

@ -19,8 +19,9 @@ module.exports = function logcatTableDirective($rootScope, $timeout, LogcatServi
LogcatService.addFilteredEntriesListener = function (entries) { LogcatService.addFilteredEntriesListener = function (entries) {
clearTable() clearTable()
var fragment = document.createDocumentFragment() //var fragment = document.createDocumentFragment()
_.each(entries, function (entry) { _.each(entries, function (entry) {
// TODO: This is not adding all the entries after first scope creation
addRow(body, entry, true) addRow(body, entry, true)
}) })
} }
@ -77,6 +78,8 @@ module.exports = function logcatTableDirective($rootScope, $timeout, LogcatServi
if (autoScroll && shouldAutoScroll() && !batchRequest) { if (autoScroll && shouldAutoScroll() && !batchRequest) {
_.throttle(scrollToBottom, 30)() _.throttle(scrollToBottom, 30)()
} }
console.log(data.message)
} }
function clearTable() { function clearTable() {

View file

@ -111,9 +111,11 @@ module.exports = function LogcatServiceFactory(socket, DeviceService, FilterStri
service.filters.entries = _.filter(service.entries, filterLine) service.filters.entries = _.filter(service.entries, filterLine)
if (typeof(service.addFilteredEntriesListener) === 'function') { if (typeof(service.addFilteredEntriesListener) === 'function') {
if (!_.isEmpty(service.filters.entries)) {
service.addFilteredEntriesListener(service.filters.entries) service.addFilteredEntriesListener(service.filters.entries)
} }
} }
}
function filterLine(line) { function filterLine(line) {
const enabled = true const enabled = true

View file

@ -1,13 +1,13 @@
module.exports = function LogsCtrl($scope, LogcatService) { module.exports = function LogsCtrl($scope, LogcatService) {
$scope.logEntries = LogcatService.entries
$scope.started = LogcatService.started $scope.started = LogcatService.started
$scope.filters = {} $scope.filters = {}
$scope.filters.levelNumbers = LogcatService.filters.levelNumbers $scope.filters.levelNumbers = LogcatService.filters.levelNumbers
LogcatService.filters.filterLines()
$scope.$watch('started', function (newValue, oldValue) { $scope.$watch('started', function (newValue, oldValue) {
if (newValue !== oldValue) { if (newValue !== oldValue) {
LogcatService.started = newValue LogcatService.started = newValue