
On tests with pythonlogging, the DEBUG headers can be quite long and make finding useful information difficult. This patch adds a small, four-button filter to the test-details page that allows a user to select which levels of logging to be displayed (INFO, WARNING, ERROR, DEBUG). This patch will likely serve as the base for additional search functionality for test details (e.g. queries). Change-Id: Ia4286861268de0e43313d3b8d7f966e94697a495
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
var directivesModule = require('./_index.js');
|
|
|
|
/**
|
|
* @ngInject
|
|
*/
|
|
function testDetailsSearch() {
|
|
|
|
/**
|
|
* @ngInject
|
|
*/
|
|
var controller = function($scope, $element) {
|
|
var self = this;
|
|
this.open = false;
|
|
this.showINFO = true;
|
|
this.showDEBUG = true;
|
|
this.showWARNING = true;
|
|
this.showERROR = true;
|
|
|
|
var update = function() {
|
|
$scope.$parent
|
|
.parsePythonLogging(self.showINFO, self.showDEBUG, self.showWARNING, self.showERROR);
|
|
};
|
|
|
|
$scope.$watch(function() { return self.query; }, update);
|
|
$scope.$watch(function() { return self.showINFO; }, update);
|
|
$scope.$watch(function() { return self.showDEBUG; }, update);
|
|
$scope.$watch(function() { return self.showWARNING; }, update);
|
|
$scope.$watch(function() { return self.showERROR; }, update);
|
|
};
|
|
|
|
return {
|
|
restrict: 'EA',
|
|
require: ['^testDetailsSearch', '^testDetails'],
|
|
scope: {
|
|
'parsePythonLogging': '&'
|
|
},
|
|
controller: controller,
|
|
controllerAs: 'search',
|
|
templateUrl: 'directives/test-details-search.html',
|
|
transclude: true
|
|
};
|
|
}
|
|
|
|
directivesModule.directive('testDetailsSearch', testDetailsSearch);
|