Add ability to download system logs

This commit is contained in:
Joseph Schorr 2014-12-23 14:01:00 -05:00
parent 5c7a9d0daf
commit 4ca877c1d4
9 changed files with 78 additions and 19 deletions

View file

@ -4879,4 +4879,10 @@ i.slack-icon {
.system-log-download-panel {
padding: 20px;
text-align: center;
font-size: 18px;
}
.system-log-download-panel a {
margin-top: 20px;
}

View file

@ -2826,6 +2826,7 @@ function SuperUserAdminCtrl($scope, $timeout, ApiService, Features, UserService,
$scope.debugLogs = null;
$scope.pollChannel = null;
$scope.logsScrolled = false;
$scope.csrf_token = window.__token;
$scope.viewSystemLogs = function(service) {
if ($scope.pollChannel) {
@ -2835,7 +2836,7 @@ function SuperUserAdminCtrl($scope, $timeout, ApiService, Features, UserService,
$scope.debugService = service;
$scope.debugLogs = null;
$scope.pollChannel = AngularPollChannel.create($scope, $scope.loadServiceLogs, 1 * 1000 /* 1s */);
$scope.pollChannel = AngularPollChannel.create($scope, $scope.loadServiceLogs, 2 * 1000 /* 2s */);
$scope.pollChannel.start();
};

View file

@ -20,7 +20,6 @@ angular.module("core-ui", [])
if (isAnimatedScrolling) { return; }
var element = $element.find("#co-log-viewer")[0];
isScrollBottom = element.scrollHeight - element.scrollTop === element.clientHeight;
if (isScrollBottom) {
$scope.hasNewLogs = false;
}

View file

@ -44,7 +44,13 @@
</ul>
<div class="system-log-download-panel" ng-if="!debugService">
Please choose a service above to view its logs.
Select a service above to view its local logs
<div>
<a class="btn btn-primary" href="/systemlogsarchive?_csrf_token={{ csrf_token }}" target="_blank">
<i class="fa fa-download fa-lg" style="margin-right: 4px;"></i> Download All Local Logs (.tar.gz)
</a>
</div>
</div>
<div class="cor-log-box" logs="debugLogs" ng-show="debugService"></div>
</div>