1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-29 18:29:44 +02:00

feat(log-viewer): add the ability to display timestamps (#1697)

This commit is contained in:
Rahul Ruikar 2018-03-25 10:36:13 +10:00 committed by Anthony Lapenna
parent 30dfd3d616
commit 80a23b5351
8 changed files with 26 additions and 12 deletions

View file

@ -3,7 +3,8 @@ angular.module('portainer.docker')
function ($scope, $transition$, $interval, TaskService, ServiceService, Notifications) {
$scope.state = {
refreshRate: 3,
lineCount: 2000
lineCount: 2000,
displayTimestamps: false
};
$scope.changeLogCollection = function(logCollectionStatus) {
@ -29,7 +30,7 @@ function ($scope, $transition$, $interval, TaskService, ServiceService, Notifica
function setUpdateRepeater() {
var refreshRate = $scope.state.refreshRate;
$scope.repeater = $interval(function() {
TaskService.logs($transition$.params().id, 1, 1, 0, $scope.state.lineCount)
TaskService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, $scope.state.lineCount)
.then(function success(data) {
$scope.logs = data;
})
@ -41,7 +42,7 @@ function ($scope, $transition$, $interval, TaskService, ServiceService, Notifica
}
function startLogPolling() {
TaskService.logs($transition$.params().id, 1, 1, 0, $scope.state.lineCount)
TaskService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, $scope.state.lineCount)
.then(function success(data) {
$scope.logs = data;
setUpdateRepeater();