mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +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) {
|
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() {
|
||||||
|
|
|
@ -111,7 +111,9 @@ 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') {
|
||||||
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) {
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue