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:
parent
97e106760f
commit
1b992d67a6
3 changed files with 9 additions and 4 deletions
|
@ -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() {
|
||||
|
|
|
@ -111,7 +111,9 @@ module.exports = function LogcatServiceFactory(socket, DeviceService, FilterStri
|
|||
service.filters.entries = _.filter(service.entries, filterLine)
|
||||
|
||||
if (typeof(service.addFilteredEntriesListener) === 'function') {
|
||||
service.addFilteredEntriesListener(service.filters.entries)
|
||||
if (!_.isEmpty(service.filters.entries)) {
|
||||
service.addFilteredEntriesListener(service.filters.entries)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue