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

View file

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

View file

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