Strip headers from logs before display, fixes #94

pull/2/head
Kevan Ahlquist 2015-02-18 22:56:55 -06:00
parent dd21a4025b
commit 65f7e32f94
1 changed files with 12 additions and 3 deletions

View File

@ -20,11 +20,20 @@ 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) {
// Replace carriage returns twith newlines to clean up output
$scope.stdout = data.replace(/[\r]/g, '\n');
// Replace carriage returns with newlines to clean up output
data = data.replace(/[\r]/g, '\n')
// Strip 8 byte header from each line of output
data = data.substring(8);
data = data.replace(/\n(.{8})/g, '\n');
$scope.stdout = data;
});
ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1, timestamps: $scope.showTimestamps}, function(data, status, headers, config) {
$scope.stderr = data.replace(/[\r]/g, '\n');
// Replace carriage returns with newlines to clean up output
data = data.replace(/[\r]/g, '\n')
// Strip 8 byte header from each line of output
data = data.substring(8);
data = data.replace(/\n(.{8})/g, '\n');
$scope.stderr = data;
});
}