1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 06:49:40 +02:00

logs page: slow on huge logs - 'show last lines' option

This commit is contained in:
jonny64 2015-02-05 19:23:57 +00:00
parent ccd27f203d
commit aead1fcc29
2 changed files with 22 additions and 3 deletions

View file

@ -4,6 +4,7 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe
$scope.stdout = '';
$scope.stderr = '';
$scope.showTimestamps = false;
$scope.tailLines = 2000;
ViewSpinner.spin();
Container.get({id: $routeParams.id}, function(d) {
@ -19,7 +20,13 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe
});
function getLogs() {
ContainerLogs.get($routeParams.id, {stdout: 1, stderr: 0, timestamps: $scope.showTimestamps}, function(data, status, headers, config) {
console.log($scope.tailLines);
ContainerLogs.get($routeParams.id, {
stdout: 1,
stderr: 0,
timestamps: $scope.showTimestamps,
tail: $scope.tailLines
}, function(data, status, headers, config) {
// Replace carriage returns twith newlines to clean up output
$scope.stdout = data.replace(/[\r]/g, '\n');
});
@ -45,4 +52,8 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe
$scope.toggleTimestamps = function() {
getLogs();
};
$scope.toggleTail = function() {
getLogs();
};
}]);