Add ability to download logs
This commit is contained in:
parent
52bee66c9f
commit
59046b2e79
5 changed files with 14 additions and 6 deletions
|
@ -25,6 +25,7 @@ html, body {
|
|||
font-size: 22px;
|
||||
padding: 6px;
|
||||
cursor: pointer;
|
||||
color: black;
|
||||
}
|
||||
|
||||
i.toggle-icon:hover {
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
<span class="right">
|
||||
<i class="fa fa-bar-chart-o toggle-icon" ng-class="chartVisible ? 'active' : ''"
|
||||
ng-click="toggleChart()" title="Toggle Chart" bs-tooltip="tooltip.title"></i>
|
||||
<a href="{{ logsPath }}" download="usage-log.json" target="_new">
|
||||
<i class="fa fa-download toggle-icon" title="Download Logs" bs-tooltip="tooltip.title"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -686,6 +686,7 @@ quayApp.directive('logsView', function () {
|
|||
$scope.logs = null;
|
||||
$scope.kindsAllowed = null;
|
||||
$scope.chartVisible = true;
|
||||
$scope.logsPath = '';
|
||||
|
||||
var logDescriptions = {
|
||||
'account_change_plan': 'Change plan',
|
||||
|
@ -781,9 +782,11 @@ quayApp.directive('logsView', function () {
|
|||
if ($scope.repository) {
|
||||
url = getRestUrl('repository', $scope.repository.namespace, $scope.repository.name, 'logs');
|
||||
}
|
||||
|
||||
|
||||
var loadLogs = Restangular.one(url);
|
||||
loadLogs.customGET().then(function(resp) {
|
||||
$scope.logsPath = '/api/' + url;
|
||||
|
||||
if (!$scope.chart) {
|
||||
$scope.chart = new LogUsageChart(logKinds);
|
||||
$($scope.chart).bind('filteringChanged', function(e) {
|
||||
|
|
Reference in a new issue