Skip to content

Commit

Permalink
feat(provider/kubernetes): runJob logs
Browse files Browse the repository at this point in the history
add support for displaying logs for runJob
  • Loading branch information
ethanfrogers committed Nov 21, 2017
1 parent f302df3 commit 455e405
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = angular
.module('spinnaker.kubernetes.pipeline.stage.disableCluster.runJobExecutionDetails.controller', [
require('@uirouter/angularjs').default,
])
.controller('kubernetesRunJobExecutionDetailsCtrl', function ($scope, $stateParams, executionDetailsSectionService) {
.controller('kubernetesRunJobExecutionDetailsCtrl', function ($scope, $stateParams, executionDetailsSectionService, $uibModal) {

$scope.configSections = ['runJobConfig', 'taskStatus'];

Expand All @@ -25,4 +25,15 @@ module.exports = angular

$scope.$on('$stateChangeSuccess', initialize);

$scope.displayLogs = () => {
$scope.logs = $scope.stage.context.jobStatus.logs || '';
$scope.jobName = $scope.stage.context.jobStatus.name || '';
return $uibModal.open({
templateUrl: require('./runJobLogs.html'),
controller: 'CloseableModalCtrl',
scope: $scope,
size: 'lg'
});
};

});
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
{{[container.imageDescription.repository, execution.trigger.tag].join(':')}}
</dd>
</span>
<dt ng-if="stage.context.jobStatus.logs">Logs</dt>
<dd ng-if="stage.context.jobStatus.logs">
<dl><a href="" ng-click="displayLogs()">Console Output (Raw)</a></dl>
</dd>
</dl>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div modal-page>
<modal-close dismiss="$dismiss()"></modal-close>
<div class="modal-header">
<h3>Console Output: {{jobName}}</h3>
</div>
<form role="form">
<div class="modal-body">
<pre>{{logs}}</pre>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="$close()">Close</button>
</div>
</form>
</div>

0 comments on commit 455e405

Please sign in to comment.